angular-cli

Angular 4 - HTTP Service 404. JSON file Not Found

ぐ巨炮叔叔 提交于 2020-01-12 07:29:48
问题 I am new in angular, and I am having problem in http service. I tried this.http.get('http://jsonplaceholder.typicode.com/posts/1') as sample data and it works. But when I used this.http.get('src/data/employees.json') it shows me 404 (Not Found) employees.service.ts import { Injectable } from '@angular/core'; import { Http } from '@angular/http'; import 'rxjs/add/operator/map'; @Injectable() export class EmployeesService { constructor(private http: Http) { } getEmployees() { this.http.get('src

ERROR in node_modules/rxjs-compat/operator/shareReplay.d.ts(2,10): error TS2305:

痴心易碎 提交于 2020-01-12 03:13:49
问题 I am trying to upgrade a basic angular skeleton app from angular 5 to angular 6 and here's the issue I am coming across when trying to run the app : ERROR in node_modules/rxjs-compat/operator/shareReplay.d.ts(2,10): error TS2305: Module '"C:/newAdmin/testing-front-end/admin-fe/node_modules/rxjs/internal-compatibility/index"' has no exported member 'ShareReplayConfig'. Here is my package.json : { "name": "admin-fe", "version": "0.0.0", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng

ERROR in node_modules/rxjs-compat/operator/shareReplay.d.ts(2,10): error TS2305:

拟墨画扇 提交于 2020-01-12 03:13:42
问题 I am trying to upgrade a basic angular skeleton app from angular 5 to angular 6 and here's the issue I am coming across when trying to run the app : ERROR in node_modules/rxjs-compat/operator/shareReplay.d.ts(2,10): error TS2305: Module '"C:/newAdmin/testing-front-end/admin-fe/node_modules/rxjs/internal-compatibility/index"' has no exported member 'ShareReplayConfig'. Here is my package.json : { "name": "admin-fe", "version": "0.0.0", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng

Types not found

寵の児 提交于 2020-01-11 12:28:09
问题 I just updated angular-cli (v1.1) and created a new project using ng new MyProj . Then I added and installed two dependencies to the project.json file: "dependencies": { ... "toastr": "2.1.2", "spin": "0.0.1" }, "devDependencies": { ... "@types/toastr": "2.1.32", "@types/spin": "2.3.30", ... "typescript": "~2.3.3" } Then I updated the autogenerated app.component.ts adding this constructor: constructor() { toastr.success('Hi') } The IDE (visual studio code) do not return any error but when I

onYouTubeIframeAPIReady on Angular2 can't find name 'YT'

安稳与你 提交于 2020-01-11 09:42:22
问题 I'm trying to insert the YouTube embed API on my angular 2 project, built with angular cli. I get a "can't find name 'YT'" when I try the approach commented on this question: onYouTubeIframeAPIReady not firing on angular2 web app My service code looks like this: loadAPI() { var tag = document.createElement('script'); tag.src = "https://www.youtube.com/iframe_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

onYouTubeIframeAPIReady on Angular2 can't find name 'YT'

时光总嘲笑我的痴心妄想 提交于 2020-01-11 09:42:11
问题 I'm trying to insert the YouTube embed API on my angular 2 project, built with angular cli. I get a "can't find name 'YT'" when I try the approach commented on this question: onYouTubeIframeAPIReady not firing on angular2 web app My service code looks like this: loadAPI() { var tag = document.createElement('script'); tag.src = "https://www.youtube.com/iframe_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

How to set up angular-cli with Visual Studio 2015 in MVC 5?

心已入冬 提交于 2020-01-11 01:25:07
问题 I'm looking for some best practices and instructions on how to set up and integrate angular-cli (webpack) with Visual Studio 2015 in MVC 5 (not Core). I realize there's a similar question asked here (how to set up asp.net angular 2 project using Angular-Cli with ASP.NET Core in Visual Studio 2015?), but that was for Asp.net Core only. My project could not move over to Core yet due to server technical issues. 回答1: Here is my solution: Keep an empty index.html Run ng build to generate index

Missing write access in mac to /usr/local/lib/node_modules

徘徊边缘 提交于 2020-01-10 14:27:49
问题 I am trying to install angular cli but it's show me Missing write access to /usr/local/lib/node_modules so, how can I fix it in my mac i try it may time but, not getting exact answer npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules npm ERR! path /usr/local/lib/node_modules npm ERR! code EACCES npm ERR! errno -13 npm ERR! syscall access npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules' npm ERR! { [Error: EACCES: permission denied,

how to use ahead-of-time compiler with angular cli webpack

[亡魂溺海] 提交于 2020-01-10 07:59:10
问题 is there a way to use AOT with angular cli? I've installed the modules (@angular/compiler @angular/compiler-cli) and when I type ngc -p scr it creates the ngFactory.ts files and compiles it to dist/tsc-out (angular cli default in tsconfig) not sure how to proceed from here :) Cheers Han 回答1: All recent beta versions of the Angular CLI support AoT via the following: ng serve --aot ng build --aot #and of course ng build --prod --aot Note: As of Angular CLI 1.0.0-beta.28 (released February 1st,

how to use ahead-of-time compiler with angular cli webpack

瘦欲@ 提交于 2020-01-10 07:58:08
问题 is there a way to use AOT with angular cli? I've installed the modules (@angular/compiler @angular/compiler-cli) and when I type ngc -p scr it creates the ngFactory.ts files and compiles it to dist/tsc-out (angular cli default in tsconfig) not sure how to proceed from here :) Cheers Han 回答1: All recent beta versions of the Angular CLI support AoT via the following: ng serve --aot ng build --aot #and of course ng build --prod --aot Note: As of Angular CLI 1.0.0-beta.28 (released February 1st,