我有以下代码,但是kendo列表不起作用。它打印[object Object]
。
(function () {
'use strict';
angular
.module('prestart.core', [
/*
third-party modules
*/
'ui.router'
]);
}());
(function () {
'use strict';
angular
.module('prestart.home', []);
}());
(function () {
'use strict';
angular
.module('prestart.services', []);
}());
(function () {
'use strict';
angular.module('prestart', [
'prestart.core',
'prestart.services',
'prestart.home'
]);
}());
(function () {
'use strict';
angular
.module('prestart')
.config(function ($stateProvider, $urlRouterProvider, $compileProvider) {
$compileProvider.debugInfoEnabled(false);
$urlRouterProvider.otherwise('/');
$stateProvider
.state('home', {
url: '/home',
cache: false,
controller: 'PrestartCtrl as prestart',
templateUrl: 'www/src/home/prestart.html'
})
});
}());
(function () {
'use strict';
angular
.module('prestart')
.run(function($rootScope, $state){
$state.go('home');
});
}());
(function () {
'use strict';
angular
.module('prestart.home')
.controller('PrestartCtrl', PrestartCtrl);
PrestartCtrl.$inject = ['$scope', 'dataLoaderService'];
function PrestartCtrl($scope, $dataLoaderService) {
var vm = this;
vm.title = "Test title"
vm.equipments = $dataLoaderService.loadPrestartData();
return vm
}
}());
(function () {
'use strict';
angular
.module('prestart.services')
.factory('dataLoaderService', dataLoaderService);
function dataLoaderService() {
return {
loadPrestartData: loadPrestartData
};
// Implementation -----
function loadPrestartData() {
return [
{
Description: 'Blah',
Category: 'Blah'
},
{
Description: 'Blah 1',
Category: 'Blah 1'
}
];
}
}
}());
的index.html
<body ng-app="prestart">
<div ui-view></div>
</body>
prestart.html
<kendo-mobile-list-view class="item-list" k-data-source="prestart.equipments">
<div k-template>
{{dataItem.Description}}
</div>
</kendo-mobile-list-view>
答案 0 :(得分:2)
多次敲我的脑袋后,我发现上面的代码在我导入https://kendo.cdn.telerik.com/2015.2.805/js/kendo.all.min.js时代替了 http://kendo.cdn.telerik.com/2015.2.902/js/kendo.all.min.js
仍然不确定为什么会这样!但现在工作!