在Angular 1中,每个组件都有,我们也可以从html模板访问它们。Angular 2的应用范围
所以在角2,我们可以宣布这样的部件,
(function(app) {
app.AppComponent =
ng.core.Component({
selector: 'my-app',
template: '<h1>My First Angular 2 App</h1>'
})
.Class({
constructor: function() {}
});
})(window.app || (window.app = {}));
我的问题是,究竟是什么在scope
角2类似的事情,在这里我们可以从这个template
访问?
如果在Angular 2中没有scope
,那么有什么方法可以绑定html
& javascript
?