以下是TypeScript代码的示例:
<fieldset class="standard">
<legend>Desktop</legend>
<ul>
<li ng-repeat="item in vm.data.desktop">
<md-checkbox aria-label="title" ng-onclick="doSomething">
{{item.label}}
</md-checkbox>
</li>
</ul>
</fieldset>
<fieldset class="standard">
<legend>Mobile</legend>
<ul>
<li ng-repeat="item in vm.data.mobile">
<md-checkbox aria-label="title" ng-true-value="false">
{{item.label}}
</md-checkbox>
</li>
</ul>
</fieldset>
<fieldset class="standard">
<legend>Metrics</legend>
<ul>
<li ng-repeat="item in vm.data.metrics">
<md-checkbox aria-label="title">
{{item.label}}
</md-checkbox>
</li>
</ul>
</fieldset>
如何在ES5中编写它,即如何在ES5中获取查询参数?
答案 0 :(得分:2)
var LoginComponent = ng.core.Component({
...
}).
Class({
constructor: [ng.router.RouteParams, function(params) {
this.token = params.get('token');
}]
});
确保提供ROUTER_PROVIDERS
,如
(function (app) {
document.addEventListener('DOMContentLoaded', function () {
ng.platform.browser.bootstrap(app.AppComponent,
[ng.router.ROUTER_PROVIDERS]);
});
})(window.app || (window.app = {}));