kendo ui & angularjs integration

本文介绍如何安装AngularJS脚手架工具并创建项目,随后集成了Kendo UI库来增强界面功能,并添加了一个使用Kendo Scheduler组件的示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1,Install AngularJs scraffold tool:generator-angular-fullstack

reference to :https://github.com/DaftMonk/generator-angular-fullstack

2,Create an angularjs project:angulardemo

1)mkdir angulardemo

2)cd angulardemo

3) yo angular-fullstack

4)grunt serve( run angularjs project)

5)browser project:http://localhost:9000

 

3,Integrate kendo ui

1)edit angulardemo/client/index.html,add the following css and js files

 

js file added behind the line:""

2)edit angulardemo/client/app/app.js

add 'kendo.directives' behind 'ui.bootstrap',looks like as below:

 

angular.module('angulardemoApp', [

'ngCookies',

'ngResource',

'ngSanitize',

'ui.router',

'ui.bootstrap',

'kendo.directives'

])

 

4, add a schedular component to angularjs project

1)edit angulardemo/client/app/main.html,looks like as below:

 

2) edit angulardemo/client/app/main.controller.js,looks like as below:

 

//---------------------------------------start

angular.module('testdemoApp')

.controller('MainCtrl', function ($scope, $http) {

var dataEvents = [

{ id:1, title:"theo@test.com", start: new Date(), end: new Date() },

{ id:2, title:"guest@test.com", start: new Date(), end: new Date() }

];

 

$scope.events = new kendo.data.SchedulerDataSource({

transport: {

read: function(options) {

options.success(dataEvents);

}

}

});

})

.directive( 'peopleScheduler',

function() {

return {

restrict: 'E',

replace: true,

scope: {

source: "=eventSource",

},

 

controller: function($scope, $timeout) {

$scope.schedulerOptions = {

date: new Date(),

dataSource: $scope.source

};

},

template: ''

}

}

);

//-------------------------end

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值