大佬教程收集整理的这篇文章主要介绍了node.js – 找不到模块’angular2/angular2′,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
@H_403_11@import {Component,View} from 'angular2/angular2'; import {FormBuilder,formDirectives } from 'angular2/forms'; @Component({ SELEctor: 'login',injectables: [FormBuilder] }) @View({ templateUrl: '/scripts/src/components/login/login.html',directives: [formDirectives] }) export class login { }
我的bootstrap.ts文件是:
@H_403_11@import {Bootstrap} from 'angular2/angular2'; import {login} from './components/login/login'; bootstrap(login);
@H_403_11@client\bootstrap.ts(1,25): error TS2307: CAnnot find module 'angular2/angular2'. client\components\login\login.ts(1,31): error TS2307: CAnnot find module 'angular2/angular2 client\components\login\login.ts(2,45): error TS2307: CAnnot find module 'angular2/forms'.
这是我的tsconfig.json:
@H_403_11@{ "compilerOptions": { "target": "es5","module": "commonjs","sourceMap": true,"watch": true,"removeComments": true,"moduleResolution": "node","emitDecoratorMetadata": true,"experimentalDecorators": true } }
我已经为
@H_403_11@tsd install angular2 --save
@H_403_11@import {Component,View,Directive,Input,Output,Inject,Injectable,providE} from 'angular2/core'; import {Bootstrap} from 'angular2/platform/browser'; import {CORE_DIRECTIVES,FORM_DIRECTIVES,NgClass,NgIf NgForm,Control,ControlGroup,FormBuilder,Validators} from 'angular2/common'; import {RouteConfig,ROUTER_DIRECTIVES,ROUTER_PROVIDERS,Router,LOCATIOnStrategy,HashLOCATIOnStrategy} from 'angular2/router'; import {http,http_PROVIDERS,requestOptions,Headers,request,requestMethoD} from 'angular2/http'
更新 –
@View现在不再在angular2中,所以不需要导入
@H_403_11@import {view} from 'angular2/core'
更新2
由于angular2在RC中,所以在这里所有进口都有突破性变化是列表,如果所有更新的进口 –
@H_403_11@angular2/core -> @angular/core angular2/compiler -> @angular/compiler angular2/common -> @angular/common angular2/platform/common -> @angular/common angular2/common_dom -> @angular/common angular2/platform/browser -> @angular/platform-browser-dynamic angular2/platform/server -> @angular/platform-server angular2/tesTing -> @angular/core/tesTing angular2/upgrade -> @angular/upgrade angular2/http -> @angular/http angular2/router -> @angular/router angular2/platform/tesTing/browser -> @angular/platform-browser-dynamic/tesTing
以上是大佬教程为你收集整理的node.js – 找不到模块’angular2/angular2′全部内容,希望文章能够帮你解决node.js – 找不到模块’angular2/angular2′所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。