angular2-cli

“Error: AccountRoutingModule is not an NgModule”

◇◆丶佛笑我妖孽 提交于 2020-03-06 03:42:10
问题 Upgrading my Angular 2.2.3 application from Angular CLI 2.0.0-beta.21 to Angular CLI 2.0.0-beta.22-1 , my ng build now fails with: Error: AccountRoutingModule is not an NgModule at AotPlugin.getNgModuleMetadata (/home/jan/src/fm-repos/fm-ui/node_modules/@ngtools/webpack/src/plugin.js:332:19) at /home/jan/src/fm-repos/fm-ui/node_modules/@ngtools/webpack/src/plugin.js:345:51 at Array.map (native) at AotPlugin.extractLoadChildren (/home/jan/src/fm-repos/fm-ui/node_modules/@ngtools/webpack/src

Class has or is using name 'SafeUrl' from external module but cannot be named

╄→尐↘猪︶ㄣ 提交于 2020-01-07 02:26:18
问题 I'm using sanitizer.bypassSecurityTrustUrl to put links to blobURL's on the page. This works just fine as long as I don't AoT compile the project. import {DomSanitizer} from '@angular/platform-browser'; export class AppComponent { constructor(private sanitizer: DomSanitizer) { } sanitize(url: string) { return this.sanitizer.bypassSecurityTrustUrl(url); } } The sanitize function takes a URL like this: blob:http://localhost:4200/7c1d7221-aa0e-4d98-803d-b9be6400865b If I use AoT compilation I

angular2-cli gives @multi styles error

佐手、 提交于 2020-01-01 07:46:21
问题 I started using angular2-cli recently and created a new project. I wanted to use bootstrap in my project hence I installed bootstrap and then wanted to import the bootstrap css file like it is shown in the the angular2-cli guide here. https://github.com/angular/angular-cli#global-library-installation After running ng serve I get the following error. ERROR in multi styles Module not found: Error: Can't resolve '/home/krishna/angular2_migrate/webui/node_modules/bootstrap/dist/css/bootstrap.min

node_modules in AngularJS 2 [ng cli] without System.config

微笑、不失礼 提交于 2019-12-24 09:57:20
问题 How do I include node_modules without System.config with AngularJS 2 projects generated with ng ? Attempts (in src/index.html ): <link rel="stylesheet" href="./node_modules/bootstrap/dist/css/bootstrap.min.css"> <link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css"> <link rel="stylesheet" href="bootstrap/dist/css/bootstrap.min.css"> <link rel="stylesheet" href="dist/css/bootstrap.min.css"> <link rel="stylesheet" href="css/bootstrap.min.css"> <link rel="stylesheet"

executing php files in a angular2cli app

帅比萌擦擦* 提交于 2019-12-24 09:40:19
问题 Creating an angular2 app using angular2cli the php files are not being compiled correctly wondering if the server that comes with angular cli understand php. If not are there any suggestions for angular2cli to understand php 回答1: Angular-cli runs a server called 'livereload server' (https://github.com/napcs/node-livereload). When you run "ng serve" you would probably be seeing a message like: "Livereload server on http: //localhost:49152 Serving on http: //localhost:4200/" Livereload server

debugging into angular 2 typescript source code

随声附和 提交于 2019-12-24 08:36:12
问题 I have an angular2 project generated by angular-cli. I want to be able to debug the angular2 typescript source code in chrome dev tools (not my own typescript code but the actual angular2 code). The angular2 npm package under node_modules only contains the transpiled javascript files but they contain source mappings. How can I make this work? Thx. 回答1: How about putting debugger; at the location you want to debug, this will trigger a breakpoint in chrome dev tools and you can work your way

Angular2: Dependencies Between Apps created with angular-cli

◇◆丶佛笑我妖孽 提交于 2019-12-23 03:01:25
问题 I am using the Angular2-cli to create two applications: MyFirstApp & MySecondApp . I whish MySecondApp to import MyFirstApp so I can reuse directive/service/component. When I import MyFirstApp , I have the following compilation error: Cannot find module 'MyFirstApp' . Here's how to reproduce : $ npm -v 3.9.3 $ node -v v6.2.1 $ npm list | grep 'angular' ├── @angular/common@2.0.0-rc.1 ├── @angular/compiler@2.0.0-rc.1 ├── @angular/core@2.0.0-rc.1 ├── @angular/http@2.0.0-rc.1 ├── @angular

Angular2: Dependencies Between Apps created with angular-cli

眉间皱痕 提交于 2019-12-23 03:01:20
问题 I am using the Angular2-cli to create two applications: MyFirstApp & MySecondApp . I whish MySecondApp to import MyFirstApp so I can reuse directive/service/component. When I import MyFirstApp , I have the following compilation error: Cannot find module 'MyFirstApp' . Here's how to reproduce : $ npm -v 3.9.3 $ node -v v6.2.1 $ npm list | grep 'angular' ├── @angular/common@2.0.0-rc.1 ├── @angular/compiler@2.0.0-rc.1 ├── @angular/core@2.0.0-rc.1 ├── @angular/http@2.0.0-rc.1 ├── @angular

Module not found: Error: Can't resolve 'hammerjs'

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-19 05:30:48
问题 I updated my Angular 2 CLI project from 1.0.0-beta.11-webpack.2 to 1.0.0-beta.11-webpack.8 via ng init . My project uses Angular 2.0.0-rc.5 and Angular Material 2.0.0-alpha.7-4 but when run with ng serve I get the following error: ERROR in ./src/app/app.module.ts Module not found: Error: Can't resolve 'hammerjs' in '/home/jan/src/fm-repos/fm-ui/src/app' @ ./src/app/app.module.ts 38:0-18 @ ./src/app/index.ts @ ./src/main.ts @ multi main ERROR in [default] /home/jan/src/fm-repos/fm-ui/node

How to serve an angular2 app in a node.js server

若如初见. 提交于 2019-12-18 16:18:23
问题 I'm building a web app using Angular2, to create the project I'm using Angular2 CLI webpack. Angular2 app uses other external packages also (Eg: Firebase). In addition to that, I need to create a REST API running on node.js How can I serve both of Angular2 app and REST API using node.js server 回答1: Use ng build to build your app into build directory. Create nodejs app to server the build directory as static content, then create route for api. Following is an example of nodejs app using