【发布时间】:2019-02-27 09:50:30
【问题描述】:
我的 app.component 得到了模板文件的名称: 客户端/imports/app/app.component.html
而不是处理我的模板及其内容。
这是我的组件代码:
import { Component, NgZone } from '@angular/core';
import { Location } from '@angular/common';
import { Router } from '@angular/router';
import template from './app.component.html';
@Component({
selector: 'app-root',
template,
})
export class AppComponent {
user: Meteor.User;
constructor(private router: Router, zone: NgZone, location:Location) {
Tracker.autorun(() => {
if (Meteor.user())
{
zone.run(() => {
this.user = Meteor.user();
});
}
else
{
this.user = undefined;
}
});
}
isMenuActive(value)
{
return location.pathname.indexOf(value) !== -1;
}
isHome()
{
return location.pathname == ""
}
}
知道为什么它似乎不再起作用了吗?
谢谢,
【问题讨论】: