我的模板未被解析
my template is not being parsed
本文关键字:我的 更新时间:2023-09-26
angular.module('dodgie', []).config(function($routeProvider){
$routeProvider.when('/home', {template:'/partials/home.html', controller:dodgieCtrl }).
otherwise({redirectTo:'/home'});
});
function dodgieCtrl($scope, $location){
$scope.doSearch = function(){
if ( !$scope.newTodo.length ) {
return;
}
};
};
内容:
<div id="content" ng-view></div>
而是:
<span class="ng-scope">/partials/home.html</span>
为什么我的部分没有被渲染?
看起来像一个错字尝试templateUrl
而不是template
:
angular.module('dodgie', []).config(function($routeProvider){
$routeProvider.when('/home', {templateUrl:'/partials/home.html', controller:dodgieCtrl }).
otherwise({redirectTo:'/home'});
});
摘自文档:
- template –
- {string=} – html 模板作为字符串,应该由 ngView 或 ngInclude 指令使用。 此属性优先于 templateUrl。
- templateUrl – {string=} – ngView 应使用的 html 模板的路径。
如果要指定 url,请使用"templateUrl"而不是"template"。
相关文章:
- 为什么不't Javascript对我的输入值进行了一些重新检查
- 可以't让我的if语句处理js中的html表单输入
- 我的单元测试选项是什么
- 将输入字段中的文本提交到我的数据库,同时将其添加到我的列表中
- 我的职位回报太快了,如何做出承诺
- 我的jQuery插件参数没有正确启动,遇到了问题
- 如何识别我的网站中的慢速设备
- 如何将JSON数据导入我的ejs模板
- JQuery添加元素需要在我的js之前再次添加JQuery脚本
- 知道为什么我的旋转木马不会自动更改图片吗
- 我的模板未被解析
- 无法将数据从firebase获取到我的html页面
- 角度图表;t显示在我的页面中
- 我的AngularJS表达式没有'不起作用
- 将电视直播频道从网站嵌入我的网站
- /undefined在我的404错误日志中多次出现
- 为什么我的d3.jsselectAll+过滤器没有过滤
- 元素在我的代码中不会.fadeTo.Don'I don’我不知道;s错误的JavaScript、JQuery、H
- 我的javascript for循环不起作用
- 将当前时间添加到我的页面上的特定部分