aot

Angular 2 Set APP_BASE_HREF with a value from a Promise / Observable

夙愿已清 提交于 2019-12-22 06:00:13
问题 I try to set the APP_BASE_HREF in the "CoreModule" with a value from a async rest call. I can't see how this is done, because the provide method needs to return a string. for example: @NgModule({ imports: [ ... HttpModule ], ... providers: [ ... ... BackendRequestClass, { provide: APP_BASE_HREF, useFactory: () => () => return '/some/path', deps: [], multi: true } ], }); but when I need the value from a webservice, I can't return the string. Any ideas how this could be done? thx 回答1: I tried

Webpack, Typescript and Angular2 with Ahead Of Time (AOT) compilation?

为君一笑 提交于 2019-12-18 11:11:12
问题 The latest release of Angular2 allows for Ahead of time (AOT) compilation, using this code in your app.bootstrap.ts file: // The browser platform without a compiler import { platformBrowser } from '@angular/platform-browser'; // The app module factory produced by the static offline compiler import { AppModuleNgFactory } from './app.module.ngfactory'; // Launch with the app module factory. platformBrowser().bootstrapModuleFactory(AppModuleNgFactory); Angular2 Official Documentation How can we

Angular Aot : app folder is not generated

谁说我不能喝 提交于 2019-12-13 06:53:44
问题 I have implemented aot in my Angular 2 project, resolved all errors an finally my "node_modules/.bin/ngc" -p tsconfig-aot.json run successfully but I see only node_modules folder in aot folder and no app folder in it . So where can I get AppModuleNgFactory to bootstrap it? This is my tsconfig-aot.json file { "compilerOptions": { "target": "es5", "module": "es2015", "moduleResolution": "node", "sourceMap": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, "lib": ["es2015",

Import single lodash functions for libraries with aot

亡梦爱人 提交于 2019-12-13 00:42:59
问题 I'm trying to use lodash with the syntax "import * as includes from 'lodash.includes';" so i don't need to install all lodash library and just the functions that I need. Everything works fine but aot. I build my library to use it in other project as a node_modules and when I do ng serve everything works fine but when doing ng serve --aot I got: "Module not found: Error: Can't resolve 'lodash.includes' in etc...". I could solve the problem by installing lodash in my library project and use it

Change batch job user identity (run as)

偶尔善良 提交于 2019-12-12 17:15:57
问题 I have created a couple of batch jobs and associated tasks to them, they run fine. But one problem is that they run with the account I have used to create the jobs in the first place. I would like to be a system account instead of my personal account (which could be deactivated if I ever leave this place) I see nowhere to change this. Do I have to change it via an SQL update statement ? Thanks. 回答1: You can log-in as whatever service user you want and setup the batch jobs, or you can use

How do I remove diacritics from a string in dynamics ax

你。 提交于 2019-12-11 16:28:04
问题 I'm trying to convert some strings, I'd like to be able to remove diacritics from strinf. (Exemple : éùèà would become euea) i have try this : static str AALRemoveDiacritics( System.String input ) { int i; System.Text.NormalizationForm FormD; str normalizedString = input.Normalize(FormD); System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); for (i = 0; i < strLen(normalizedString); i++) { System.Char c = normalizedString[i]; if (CharUnicodeInfo.GetUnicodeCategory(c) !=

reducers is not being called when using --aot=true

不羁的心 提交于 2019-12-11 14:58:21
问题 I have angular 4.4.3 project with ngrx 4.0.3 and angular-cli 1.1.2. Everything is OK when i'm not using aot option, but when i'm using --aot=true I can see that reducers not being called (because I cannot see console output 'REDUCER FIRED'): action: import { Post } from '../models'; import {Action as NgRxAction} from '@ngrx/store'; export interface Action extends NgRxAction { payload?: any; } @Injectable() export class PostActions { static LOAD_POSTS = '[Post] Load Posts'; loadPosts(): Action

Reg ex to ignore .spec.ts files for AOT angular 5 build

让人想犯罪 __ 提交于 2019-12-11 08:02:04
问题 Angular 5 ngtools isn't ignoring all ".spec.ts" files in my production build. How would I exclude **.spec.ts* but keep any other .ts ? /(?:.ngfactory.js|.ngstyle.js|.ts)$/ From my webpack.prod.config.js... module.exports = merge(baseConfig, { devtool: "source-map", module: { rules: [ { // AOT mode support for production test: /(?:\.ngfactory\.js|\.ngstyle\.js|\.ts)$/, loader: '@ngtools/webpack' } ] }, Click here on link example of image to regex101.com 回答1: If you plan to allow files with

Calling ServiceStack.Text.JsConfig.RegisterTypeForAot<T>(); with MonoTouch causes SIGSEGV on startup on device

社会主义新天地 提交于 2019-12-11 07:31:44
问题 I've been trying to use ServiceStack.Text.JsConfig.RegisterTypeForAot(); in an method that is not used at runtime to cure my AOT issues but have run into other weird issues when I have too many calls to it. I've got 10 calls to various types including classes, structs and enums. When I have 9 calls everything works fine, I've shuffled some of the types around so I'm pretty sure it is the number. When I have 10 calls I get ... Stacktrace: at System.MonoType.ToString () [0x00000] in /Developer

Setting default value on a field?

感情迁移 提交于 2019-12-11 05:48:23
问题 I'm adding a new field to an existing Table (not a "core" one, but one that was created by an inhouse dev previously) and I'm trying to set a default value for it. I created a field of type Int , but now by default it's all 0's for the records that are already there. Is there any way to define a default value for that field, for all the existing records and to be inserted records ? Ultimately, what I'm trying to achieve is that I want a configurable field (ShowOnReport) so certain records won