Angular Day1
Angular Day1
“formerly Angular 4”
Benefits worth the cost
https://angular.io/docs
Angular
Angular empowers developers to build
applications that live on the web, mobile,
or the desktop
Knowledge
ES6
TypeScript
Installation
npm install –g @angular/cli
npm install –g typscript
TypeScript
TypeScript is a typed
superset of JavaScript
Supported By Microsoft
It is a compiled language
it catches errors before runtime
Object oriented.
Enum
enum Color {Blue,Red,Green} ;
var c : Color = Color.Blue;
Type Annotation
var identifier [[:type] = initVal];
Example:
let val:any=“abc xyz”
(<string>val).length
Function
We can specify returning type
Use default parameter
Use …rest parameter
Syntax
interface Point {
readonly x: number;
readonly y: number;
}
interface myFunInterface {
(src: string, str: string): string;
}
http://microsoft.github.io/TypeSearch/
Add reference to declares a dependency on a
package.
/// <reference types="jquery" />
Triple-slash directives are single-line comments
containing a single XML tag. The contents of the
comment are used as compiler directives.
Decorators
It is a function that add metadata to the
thing it is attached to
Used to customize our class at design time
Decorators are an experimental feature
that may change in future releases.
tsc --target ES5 --experimentalDecorators f.ts
Multiple decorators can be applied to a
declaration
Decorator
Assignment
Assignment Account
Acc_no
Balance
<<IAcccount>>
debitAmount()
Date_of_opening
creditAmount()
getBalance()
addCustomer()
removeCustomer()
<<IAcccount>>
<<IAcccount>>
Saving_Account Current_Account
Min_Balance Interest_rate
Assignment
Implement the give system in previous
using TypeScript
Implement any required class, properties
and method
Note: Account is an abstract class
Assume your datatype