簡體   English   中英

AngularJS Kendo模板不起作用

[英]AngularJS Kendo template not working

我有以下代碼,但劍道列表不起作用。 打印[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>

多次敲打頭后,我發現導入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

仍然不確定為什么會這樣! 但是現在可以使用!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM