不要将HTML + TypeScript渲染到流星模板中

时间:2015-08-06 01:21:10

标签: meteor typescript angular

我正在使用Meteor + Angular2 + Typescript + FlowRouter + FlowLayout。成功登录后,它会呈现主页,但不会呈现<body> {{> main }} </body> <template name="main"> {{> Template.dynamic template=main}} </template> <template name="home"> <nav> <a href="/">Home</a> <a href="/logout">Logout</a> </nav> <parties-list></parties-list> <script>System.import('client/parties-list');</script> </template> 。如果我再次刷新,它就可以工作。

的index.html

FlowRouter.route('/', {
    name: 'home',
    action: function() {
        Tracker.autorun(function() {
            if (!Meteor.userId()) {
                FlowRouter.go('/login');
            } else {
                FlowLayout.render('main', { main: 'home' });
            }
        });
    }
});

router.js

import {Component, View, bootstrap, For, If} from 'angular2/angular2';
@Component({
    selector: 'parties-list'
})
@View({
    templateUrl: 'client/parties-list.ng.html',
    directives: [For, If]
})
class PartiesList {
    constructor() {}
}
bootstrap(PartiesList);

方-list.ts

<div style="position: absolute; visibility: inherit; overflow: hidden; cursor: default; color: white; text-align: left; width: 84px; height: 14px; padding-left: 1px; padding-top: 1px; left: 1px; top: 1px; background-color: rgb(102, 0, 153);"></div>

0 个答案:

没有答案