0
This is a shortened version of the js file
var linksManager = angular.module('linksManager', ['ui']);
angular.bootstrap(document, ['linksManager']);
linksManager.factory('linksData', function() {
var linksData = [
{
text: 'Menu Item 1',
url: '#'
}, {
text: 'Menu Item 2',
url: '#',
submenu: [
// more data ...
});
功能linksRarrange($範圍,linksData){$ = scope.links linksData; }移動的數據,並且不能從那裏得到它
的linksData
之前直接在控制器
$scope.links = [
{
text: 'Menu Item 1',
url: '#'
}, {
text: 'Menu Item 2',
url: '#',
submenu: [
// more data ...
內,它工作得很好,爲什麼共享現在無法正常工作?
這是HTML,它現在不顯示任何內容:
<div class="nav-manage clearfix" ng-app="linksManager">
<div class="links-arrange" ng-controller="linksRarrange">
<ul class="sortable">
<li ng-repeat="level1link in links">
<a href="{{level1link.url}}">{{level1link.text}}</a>
<ul class="sortable">
<li ng-repeat='level2link in level1link.submenu'>
<a href="{{level2link.url}}">{{level2link.text}}</a>
<ul class="sortable">
<li ng-repeat='level3link in link.level2link'>
<a href="{{level3link.url}}">{{level3link.text}}</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>