我正在尝试创建一个完整的状态,FormioResourceProvider
但我无法在我的文件夹中创建自定义抽象视图,我views/resource/resource.html
在我的资源提供程序中将其设置为抽象模板。
angular.module('demoApp').provider('FoodSafetyResource', function() {
return {
$get: function() { return null; },
templates: {
abstract: 'views/resource/resource.html',
view: 'views/resource/view.html',
index: 'views/resource/index.html',
create: 'views/resource/create.html'
},
controllers: {
index: '',
view: '',
delete: '',
}
};});
另外,我注册了我的资源提供者FormioResourceProvider.register
// Register all of the resources.
angular.forEach(AppConfig.resources, function(resource, name) {
FormioResourceProvider.register(name, resource.form, $injector.get(resource.resource + 'Provider'));
});
我看不到这个的抽象视图$state.go('foodsafetyIndex()')
<div class="panel panel-headline">
<div class="panel-heading">
<h2>{{ currentResource.name | capitalize }}</h2>
</div>
<div class="panel-body">
<div class="col">
<ul class="nav nav-tabs">
<li role="presentation" ng-class="{active:isActive(currentResource.name + '.view')}" ><a ui-sref="{{ baseName }}.view()">View</a></li>
<li role="presentation" ng-class="{active:isActive(currentResource.name + '.edit')}"><a ui-sref="{{ baseName }}.edit()">Edit</a></li>
<li role="presentation" ng-class="{active:isActive(currentResource.name + '.delete')}" ><a ui-sref="{{ baseName }}.delete()">Delete</a></li>
</ul>
<div ui-view></div>
</div>
</div>
我怎样才能得到我在索引状态下做的这个模板?