【发布时间】:2018-11-19 17:33:17
【问题描述】:
我正在做一个 angularjs 博客教程,在代码示例中我看到了这个新文件类型“tpl.html”:
$routeProvider
.when('/', {
templateUrl: 'views/post-list.tpl.html',
controller: 'PostListController',
controllerAs: 'postlist'
})
.when('/post/:postId', {
templateUrl: 'views/post-detail.tpl.html',
controller: 'PostDetailController',
controllerAs: 'postdetail'
})
.when('/new', {
templateUrl: 'views/post-create.tpl.html',
controller: 'PostCreateController',
controllerAs: 'postcreate'
});
这是什么文件类型?和html文件有区别吗?
【问题讨论】: