如何从JavaScript文件直接指向.cshtml视图?例如,为什么不能在angular.js中使用.cshtml视图?就像这个例子一样:
当然可以有一个返回任何内容的动作方法,但我想知道是否可能直接引用Razor视图。
.directive('encoder', ($timeout) => {
return {
restrict: 'E',
transclude: true,
scope: 'isolate',
locals: { service: 'bind' },
templateUrl: 'encoderTemplate.cshtml' // <-- that's not possible?
}
});
当然可以有一个返回任何内容的动作方法,但我想知道是否可能直接引用Razor视图。