Cannot find module 'angular2/angular2'

后端 未结 11 893
有刺的猬
有刺的猬 2020-11-30 06:43

I am developing an node app with angular2 and gulp. I have written a component file login.ts as follows:

import {Component, View} from \'angular2/angular2\';         


        
11条回答
  •  旧巷少年郎
    2020-11-30 07:06

    Please note that as form Angular2 final release the correct answer is this.

    import {Component, View, Directive, Input, Output, Inject, Injectable, provide} from 'angular/core'; 
    
    import {bootstrap} from 'angular/platform/browser';
    
    import {CORE_DIRECTIVES, FORM_DIRECTIVES, NgClass, NgIf  NgForm, Control, ControlGroup, FormBuilder, Validators} from 'angular/common';
    
    import {RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS, Router, LocationStrategy, HashLocationStrategy} from 'angular/router';
    
    import {Http, HTTP_PROVIDERS, RequestOptions, Headers, Request, RequestMethod} from 'angular/http'
    

    This is true as said in yups update 2 from above

    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
    

提交回复
热议问题