Import unable to locate angular2 in beta.1

后端 未结 1 842
-上瘾入骨i
-上瘾入骨i 2021-01-07 01:29

The sample code found in AngularJS 2.0 Getting Started with Visual Studio works with alpha.28 version. When I change the scripts from



        
相关标签:
1条回答
  • 2021-01-07 01:48

    Basically it is causing error from you app.ts file where you have your component resides.

    For importing Component, View & bootstrap old version has angular2/angular2 path

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

    Everyone knows day by day angular2 API has changed rapidly.

    So as per current version you need to do angular2/core for importing Component, View

    & bootstrap should imported from angular2/platform/browser js

    import {Component, View} from 'angular2/core';
    import {bootstrap} from 'angular2/platform/browser';
    import {NgFor} from 'angular2/common'; //common things are there in common module
    

    Other than that Rx jx component has been moved out from angular2.dev.js, if you have any code related then you need to include Rx.js separately in your app.

    Also you need to include angular2-polyfills.js & es6-shim.js js files to enable support for the older application.

    Angular2 Changelog.md

    0 讨论(0)
提交回复
热议问题