This document provides an overview of using Kendo UI components with Angular. It discusses why one might choose to use Kendo UI, describes some of the main component groups like buttons, charts, dropdowns, grids, layout, popup, dialog, date inputs and inputs. It also covers how to install and configure themes, and how to import, display and handle events of the different components. The document is intended as a guide for developers looking to get started with building applications using Kendo UI and Angular.
Kendo UI withAngular
Chris Noring
Digital McKinsey
@chris_noring
2.
Why should Icare
You are on a time crunch in a dev project
Some functionality you need is hard to write
You might not be a backend and frontend ninja
You want to focus on solving
business problems over tech problems
You need tech support for bugs, or specific features
3.
Component package
overview
Free componentpackages
Onsen
Angular Material
Bootstrap
Simpler apps
Packages that cost money
Infragistics
KendoUI
AG-grid
When I need more
functionality
Ready made themes
1495 - 1995 $
899 $
495-795$
Best grid, but just a grid!
Buttons
Button, a normalbutton
ButtonGroup, buttons belonging to same context
perform action
show selection
carry out
action
SplitButton
DropDownButton, popup list with action items
carry out action
12.
Install & Usage
Buttons
npminstall --save
@progress/kendo-angular-buttons
@progress/kendo-angular-l10n
@angular/animations
@NgModule({
imports : [ ButtonsModule ]
})
export class SomeModule {}
import { ButtonsModule } from '@progress/kendo-angular-buttons';
All buttons
@NgModule({
imports : [ ButtonModule ]
})
export class SomeModule {}
import { ButtonModule } from '@progress/kendo-angular-button'; Specific button
13.
Buttons
Display buttons
@Component({
selector: 'buttons-example',
template:`
<div>
<button kendoButton [icon]="'refresh'">Default button</button>
// Image icon
<button kendoButton [imageUrl]="'https://demos.telerik.com/kendo-ui/content/shared/icons/sports/
snowboarding.png'">Snowboarding</button>
// FontAwsome icon
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"
<button kendoButton [iconClass]="'fa fa-key fa-fw'">Button</button>
</div>
`
})
export class ButtonsExampleComponent implements OnInit {
constructor() { }
ngOnInit() { }
}
Built in Kendo icons
Point out url
Point out CSS class,
ex font-awesome
14.
Buttons with Rippleeffect,
i.e Material Look and Feel
import { RippleModule } from '@progress/kendo-angular-ripple';
@NgModule({
imports: [
RippleModule
]
})
export class AppModule {
}
npm install @progress/kendo-angular-ripple
<div kendoRippleContainer>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<button kendoButton [iconClass]="'fa fa-key fa-fw'">Button</button>
</div>
15.
Charts
Sparkline
Small chart withoutaxis, legends, coordinates, titles etc..
Line, Bar, Column, Area, Pie, Bullet
StockChart
Made especially for visualising price movement
of any financial instrument over time
Chart, so many types supported
Area, Bar, Box Plot, Bubble, Bullet, Donut,
Funnel, Line, Pie, Polar, Radar, RangeArea,
RangeBar, Scatter, Waterfall
Install & usage
Dateinputs
npm install --save
@progress/kendo-angular-dateinputs
@progress/kendo-angular-intl
@progress/kendo-angular-l10n
@angular/animations
import { DateInputsModule } from '@progress/kendo-angular-dateinputs';
@NgModule({
bootstrap: [AppComponent],
imports: [DateInputsModule]
})
export class AppModule {}
All DateInputs
import { CalendarModule } from '@progress/kendo-angular-dateinputs';
@NgModule({
bootstrap: [AppComponent],
imports: [CalendarModule]
})
export class AppModule {}
Specific DateInput
40.
Display date inputs
Dateinputs
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'date-input-example',
template: `
<kendo-calendar [disabled]="true"></kendo-calendar>
`
})
export class DateInputsExampleComponent implements OnInit {
constructor() { }
ngOnInit() { }
}
Possible to set
in disabled state
41.
Date inputs
import {Component, OnInit } from '@angular/core';
@Component({
selector: 'date-input-example',
template: `
<kendo-calendar [disabled]="true"></kendo-calendar>
<kendo-calendar [focusedDate]="focusedDate" ></kendo-calendar>
<kendo-calendar [value]="value"></kendo-calendar>
`
})
export class DateInputsExampleComponent implements OnInit {
public focusedDate: Date = new Date(2017, 11, 10);
public value: Date = new Date(2017, 11, 10);
constructor() { }
ngOnInit() { }
}
Open calendar in the right week
Select a specific day
Kendo drawing
Offers asimple object model for building and manipulating
visual scenes.
The scenes can be rendered as SVG and PDF documents,
Canvas elements, and PNG images
Our own graphics lib,
lots of Kendo components
use this one under the hood
Kendo drawing
import {drawScene } from './draw-scene';
@Component({
selector: 'my-app',
template: `
<div #surface></div>
`
})
export class AppComponent implements AfterViewInit, OnDestroy {
@ViewChild('surface')
private surfaceElement: ElementRef;
private surface: Surface;
public ngAfterViewInit(): void {
drawScene(this.createSurface());
}
public ngOnDestroy() {
this.surface.destroy();
}
private createSurface(): Surface {
// Obtain a reference to the native DOM element of the wrapper
const element = this.surfaceElement.nativeElement;
// Create a drawing surface
this.surface = Surface.create(element);
Define a surface element
Draw scene
57.
Kendo drawing
export functiondrawScene(surface: Surface) {
// This rectangle defines the image position and size
const imageRect = new Rect(
new Point(5, 5),
new Size(50, 50)
);
// Create the image
const imageUrl = `http://www.telerik.com/kendo-angular-ui/components/drawing/images/diego.jpg`;
const image = new Image(imageUrl, imageRect);
// Create the text
const text = new Text(
"Diego Roel",
new Point(60, 25),
{ font: "bold 15px Arial" }
);
// Place all the shapes in a group
const group = new Group();
group.append(image, text);
// Translate the group
group.transform(
transform().translate(50, 50)
);
// Render the group on the surface
surface.draw(group);
Draw image
Draw text
Move to position
Create group and
append objects to it
Draw the group on the surface
58.
Summary
Consider if ina time crunch with a project
Has three themes + you can create your own
Supports everything from UI components to
Data Query and exports like Excel + PDF
Even helps with posting, deleting files against a backend
Even helps with posting, deleting files against a backend
There is more like internationalization,
ton of more controls, GO EXPLORE