angular-cli

Angular-cli build with base-href also return programs folder when using git bash

偶尔善良 提交于 2020-01-01 09:39:10
问题 I'm trying to build my angular project with the angular-cli in a MINGW64 docker box on a Windows 7 Pro machine. In git bash, the command I am using is: ng build --prod --base-href /appcontext/ What I am trying to do is to modify my current base tag with attribute href="/" to href="/appcontext/" Instead I get as a result a base tag with href="C:/Program Files/Git/appcontext/" . Anyone any idea? 回答1: Late answer, but I faced with the similar problem and it occured that issue in MINGW (I tried

Angular 2 Lazy loading a NgModule in a NPM module with angular router

邮差的信 提交于 2020-01-01 09:25:30
问题 I have been lazy loading modules in routes e.g. export const HomeRoute: Route = { path: '', component: HomeComponent, canActivate: [AuthGuard], children: [ {path: 'dashboard', loadChildren: 'app/+dashboard/db.module#DashboardModule'} ] }; I would like to put my "pages" into NPM modules. What is the route to the node_module that I should use in the loadChildren attribute? I am using angular-cli 1.0.0-beta.16 I have tried {path: 'lazy', loadChildren: '../node_modules/hello-world/components

Angular5 :polyfills.ts & \main.ts is missing from the TypeScript compilation

笑着哭i 提交于 2020-01-01 08:20:00
问题 This is my Angular5 project structure. Both tsconfig.app.json and package.json contain this section "include": [ "/src/main.ts", "/src/polyfills.ts" ] But no matter what I try I still get this error: \polyfills.ts & \main.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. Anyone has idea what's missing here? tsconfig.json { "compileOnSave": false, "compilerOptions": { "outDir": "./dist/out-tsc", "sourceMap": true,

Angular5 :polyfills.ts & \main.ts is missing from the TypeScript compilation

喜欢而已 提交于 2020-01-01 08:19:30
问题 This is my Angular5 project structure. Both tsconfig.app.json and package.json contain this section "include": [ "/src/main.ts", "/src/polyfills.ts" ] But no matter what I try I still get this error: \polyfills.ts & \main.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. Anyone has idea what's missing here? tsconfig.json { "compileOnSave": false, "compilerOptions": { "outDir": "./dist/out-tsc", "sourceMap": true,

Installing 3rd Party Applications with Angular-CLI

最后都变了- 提交于 2020-01-01 07:06:28
问题 I am new to angular-cli. I want to install the npm library mdbootstrap. I followed the instructions here: Angular CLI Instructions Specifically, I did this: I installed mdbootstrap via npm install bootstrap . I added all of the files in the dist directory to my angular-cli.json . angular-cli.json additions: "styles": [ "../node_modules/mdbootstrap/css/bootstrap.min.css", "../node_modules/mdbootstrap/css/mdb.min.css", "../node_modules/mdbootstrap/css/style.css" ], "scripts": [ "/node_modules

NullInjectorError: No provider for NgZone! (Angular 6 library)

若如初见. 提交于 2020-01-01 05:54:14
问题 Summary I created an Angular 6 library, but I get an error when I try to use it outside of the project in which it was created. This looks like a lot of code, but it's mostly boilerplate generated by the CLI. Minimal Working Test Case I created a very basic library with the Angular 6 CLI. ng new mylib cd mylib ng generate library example ng build --prod example I can then add <lib-example></lib-example> to src/app/app.component.html , run ng serve , and see the example component works as

Routing an Angular 2 app with Web API

拜拜、爱过 提交于 2020-01-01 05:45:09
问题 I have an Angular 2 application created with Angular CLI. This has to call a .NET 4.6 Web API. The route setup of this is driving me nuts. For Angular, the default folder for output is /dist . Angular CLI does all the minification and tree-shaking you can dream of and then outputs both its JavaScript files and index.html to that folder. So if I run index.html , those files are retrieved from the same folder. Everything works well, because index.html contains a tag like this one: <base href="/

Angular CLI Generate Library with SASS

余生颓废 提交于 2020-01-01 05:11:28
问题 I have an Angular6 app that I am trying to create a library for. I was able to generate a library project but when I generate the component for the library, Angular CLI is creating it with .css files. How can I get it to create .scss files? Here are the commands I'm using to create the project: ng new example-app --style=scss rename example-app example cd example ng generate library example --prefix=exam --style=scss ng generate component test --project=example The --style=scss option on the

Angular CLI Generate Library with SASS

烈酒焚心 提交于 2020-01-01 05:11:19
问题 I have an Angular6 app that I am trying to create a library for. I was able to generate a library project but when I generate the component for the library, Angular CLI is creating it with .css files. How can I get it to create .scss files? Here are the commands I'm using to create the project: ng new example-app --style=scss rename example-app example cd example ng generate library example --prefix=exam --style=scss ng generate component test --project=example The --style=scss option on the

Angular CLI Hot Module Reload

南笙酒味 提交于 2020-01-01 04:44:05
问题 I followed this github story: https://github.com/angular/angular-cli/wiki/stories-configure-hmr I am able to see changes after auto-refresh when I do ng serve (environment is Dev), however with ng serve --hmr -e=hmr , the page auto refreshes (like a flicker) without changes. I have to press F5 to see the changes. HMR works fine, because I see my terminal output things like: NOTICE Hot Module Replacement (HMR) is enabled for the dev server. The project will still live reload when HMR is