混淆有关如何Angular2导入它的组成 [英] Confuse about how Angular2 import its component
问题描述
所有
我是pretty新AngularJS 2.0,当我看到它的快速启动和其他一些帖子,有一个舶来品这样一行:
I am pretty new to AngularJS 2.0, when I read its quickstart and some other posts, there is a "import" line like:
import {Component, View, bootstrap} from 'angular2/angular2';
我想知道的是,angular2 / angular2',我怎么怎么知道什么是根目录(或结构),我应该从导入?
I am wondering where is that 'angular2/angular2', how how do I know what is the root directory(or structure) that I should import from?
感谢
推荐答案
注意!!更新到公测angular2!
IMPORTANT !! UPDATED to angular2 beta !!
由@Guenter说yups angular2 / angular2
不是任何路径,而这是predefined angular2的捆绑。为此,我们已经导入
system.js之前我们在index.html的角度。
yups as said by @Guenter angular2/angular2
is not any path rather it is predefined bundle of angular2. for this we have already imported
system.js before our angular in the index.html.
如果你看的角bundal 你可以看到有 System.register(angular2 /核心,......
if you look at the source code of angular bundal you can see there's System.register("angular2/core", ....
和告诉systemjs做什么。您可以找到更多...
and that tells systemjs what to do. You can find more here...
现在根据所有更新导入列表在这里...
now according to all updates the list of import is here...
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'
这篇关于混淆有关如何Angular2导入它的组成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!