角度2组件不显示

时间:2016-03-25 13:49:34

标签: angular angularjs-routing

我有以下组件,当我的路由器路由到时,我得到以下屏幕:

enter image description here

以下是组件:

temp[j+1] = (char)CHARSUM-(temp[j]+temp[j+1]);

为什么这个渲染不正确?

注意:如果我改变路由以使用不同的组件,它可以正常工作,所以我认为这是特定的组件,或者可能是一些依赖性问题。

1 个答案:

答案 0 :(得分:3)

您需要在templateUrl装饰器中使用template代替Component

@Component({
  selector: 'login',
  templateUrl: 'client/dev/user/templates/login.html', // <-----
  styleUrls: ['client/dev/todo/styles/todo.css'],
  providers: []
})
export class LoginComponent {
  (...)
}
相关问题