【发布时间】:2016-03-24 07:44:52
【问题描述】:
我正在尝试在 Angular Meteor 应用程序中使用 useraccounts:bootstrap,方法是使用 urigo:angular-blaze-template 包来使用 useraccounts:bootstrap 提供的 blaze 模板 {{> atForm}}。
问题:我在网页上遇到错误:meteorTemplate: There is no template with the name 'todoList'。有什么想法吗?
useraccounts.html
<template name="todoList">
{{> atForm}}
</template>
<blaze-template name="todoList"></blaze-template>
routes.js
angular.module('myApp').config(function($urlRouterProvider, $stateProvider, $locationProvider) {
$locationProvider.html5Mode(true)
$stateProvider
.state('useraccounts', {
url: '/useraccounts',
templateUrl: 'client/useraccounts/views/useraccounts.html',
})
$urlRouterProvider.otherwise('/foo')
})
按照 Jos Jarink 的建议,丢失模板错误消失了!但是{{> atForm }}不包含任何内容,只有下面的代码嵌套在uiViewdiv里面。
blaze-html-templates 包已被删除,添加这个回来似乎没有任何区别。
<div class="container">
<!-- uiView: -->
<div ui-view="" class="ng-scope">
<blaze-template name="atForm" class="ng-scope">
<div class="at-form ng-scope">
</div>
</blaze-template>
</div>
</div>
更新
Github 回购: https://github.com/nyxynyx/useraccounts-angular
在.meteor/packages 中取消注释blaze-html-templates 会出现错误
Errors prevented startup: While determining active plugins:
error: conflict: two packages included in the app (angular-templates and templating) are both trying to handle *.html
【问题讨论】:
-
我在这里回答了类似的问题:stackoverflow.com/a/34375238/1426570
标签: javascript angularjs meteor angular-meteor