【发布时间】:2017-08-24 15:30:23
【问题描述】:
我是 angular 2 的新手。我正在将 angularjs 2 与 asp.net MVC 一起使用,我想在 app.component 中使用我的 _layout.cshtml(master page) 作为 templateUrl。
就像在 angular 1 中一样,我在 _layout 页面上使用 ng-app="my-app" 并且我可以在每个内容页面上使用 angular。如何在 angularjs 2 中做到这一点
这是我的 app.component.ts
import { Component } from '@angular/core';
@组件({
selector: 'my-app',
templateUrl:'/views/shared/_layout.cshtml'//i want to do that
}) 导出类 AppComponent {
test: string = "";
}
我想使用我的视图(cshtml)作为 templateUrl 并直接想在视图上使用 angularjs
【问题讨论】:
标签: angular