SlideShare a Scribd company logo
1 of 44
Download to read offline
ANGULAR DART
STÉPHANE ESTE-GRACIAS - 15/03/2017
ANGULAR DART
THANKS TO
NYUKO.LU REYER.IO
INTRODUCTION
ANGULAR DART - INTRODUCTION
ANGULAR DART: ORIGINS
▸ Open Source Software under a MIT license
▸ Mainly developed by Google engineers
▸ Pitfall and best practices from AngularJS 1.x
▸ AngularDart 1.5 was the sandbox for AngularJS/Dart 2.x
▸ AngularDart 2.x now
ANGULAR DART - INTRODUCTION
ANGULAR DART: GOALS
▸ Help developers build
▸ Web Applications
▸ Productivity
▸ Write less code

Google teams report 2x productivity
▸ Performance
▸ Stability
GETTING STARTED
ANGULAR DART - GETTING STARTED
INSTALL ANGULAR DART ON YOUR FAVORITE PLATFORM
▸ Install Dart on MacOS, Linux Ubuntu/Debian, Windows
▸ Install an IDE
▸ Recommended: WebStorm
▸ Dart Plugins available for
▸ Atom, Sublime Text 3, Visual Studio Code, Emacs, Vim
OVERVIEW
ANGULAR DART - OVERVIEW
SYMBOLS
▸ () parentheses
▸ [] square brackets
▸ {} curly brackets
▸ <> angle brackets
▸ {{}} moustache
ANGULAR DART - OVERVIEW
DART’S WEB STACK
ANGULAR DART
COMPONENTS
ANGULAR DART
DART CORE LIBRARIES
DART
ECOSYSTEM
DART LANGUAGE
ANGULAR DART - OVERVIEW
BUILDING BLOCKS (1/2)
ANGULAR DART - OVERVIEW
BUILDING BLOCKS (2/2)
▸ Module
▸ Metadata / Annotation / Decorator
▸ Template
▸ Directive
▸ View
▸ Component
▸ Data Binding
▸ Service
▸ Dependency Injection
▸ Injector
▸ Provider
▸ Bootstrapping
ANGULAR DART - OVERVIEW
MODULE
▸ Module refers to a Dart compilation unit
▸ Library (i.e. set of files in your application package)
▸ If Dart file has no library or part directive, then that file itself is a library
▸ Package (i.e. shared set of libraries)
▸ e.g. angular2, angular2_components packages
ANGULAR DART - OVERVIEW
METADATA / ANNOTATION / DECORATOR
▸ Metadata refers to a Dart metadata annotation
▸ Begins with the character @
▸ Followed by either a reference to
▸ a compile-time constant such as

Component, Directive, Input, Output…
▸ or a call to a constant constructor
▸ Metadata tells Angular how to process the annotated item
ANGULAR DART - OVERVIEW
DIRECTIVE
▸ Template are dynamic. Angular transforms the DOM

according to the instructions given by directives
▸ Directive is a Dart class with @Directive annotation
▸ There are three kinds of directives in Angular:
▸ Components with @Component annotation are building blocks of an Angular
application
▸ Attribute directives change the appearance or behaviour of a DOM element
▸ Structural directives alter layout by adding, removing, and replacing elements in DOM
ANGULAR DART - OVERVIEW
VIEW
▸ View is a portion of the screen that
▸ Displays information
▸ Responds to user actions such as clicks, mouse moves and keystrokes
▸ Contains other views
▸ Angular renders a view under the control of one or more Directives
▸ Often convenient to refer to a Component as a View
▸ Any Views might be loaded and unloaded dynamically
▸ Typically under the control of a router
ANGULAR DART - OVERVIEW
COMPONENT
▸ Directive with an embedded view are called Component
▸ Component is a Dart class with @Component annotation
▸ So it’s a dart class responsible for
▸ Exposing data to a view
▸ Handling most of the view’s display
▸ Handling user-interaction logic
▸ Can be built with input parameters identified with @Input annotation on property type
▸ Can emit event identified with @Output annotation on event’s property
▸ Similar to “controller” or “view-model” in MVC / MVVM design pattern
ANGULAR DART - OVERVIEW
TEMPLATE
▸ Template is a chunk of HTML that includes
▸ Data bindings
▸ Directives
▸ Other Components
ANGULAR DART - OVERVIEW
DATA BINDING
▸ Data binding enables
▸ Data to flow from 

Component to DOM and vice-versa
▸ Possible data bindings are
▸ Interpolation
▸ Property / Event / Attribute / Class / Style binding
▸ Two-way data binding
ANGULAR DART - OVERVIEW
SERVICE
▸ Service is a class with a focused purpose
▸ Separates data and/or logic from Views or Components
▸ Encapsulates any value, function, or feature that your application needs
▸ e.g. logging service, data service, application configuration…
ANGULAR DART - OVERVIEW
DEPENDANCY INJECTION (DI)
▸ Supplies instance of a class with fully-formed “dependencies”
▸ A Provider is a recipe for creating new instances of a “dependency”
▸ An Injector maintains a cache of previously created service instances
▸ To use DI, register the Provider’s “dependency”
▸ when bootstrapping the Application
▸ or in the Component metadata
ANGULAR DART - OVERVIEW
BOOTSTRAPPING
▸ Bootstrapping consists on
▸ An application's top level "root" Component

i.e. first Component that is loaded for the application

by convention, AppComponent
▸ and optionally registers service Providers with DI
ANGULAR DART - OVERVIEW
OTHERS
▸ Template expression
▸ Pipes
▸ Router
▸ Routing component, RouterOutlet
▸ …
ANGULAR DART - OVERVIEW
WRAP UP
ANGULAR DART
COMPONENTS
ANGULAR DART
DART CORE LIBRARIES
DART
ECOSYSTEM
DART LANGUAGE
CODE SAMPLE
ANGULAR DART - CODE SAMPLE
REMINDER: NOTATIONS
▸ PascalCase
▸ Class names (e.g. AppComponent)
▸ camelCase
▸ Function, property, and method names (e.g. ngOnInit, updateMessage)
▸ snake_case
▸ Dart package names and filenames (e.g. my_app / app_component.dart)
▸ dash-case
▸ Directive selectors (e.g. my-app)
ANGULAR DART - OVERVIEW
COMPONENT / TEMPLATE / DIRECTIVE / BOOTSTRAP / ROOT INJECTOR / SERVICE
import 'package:angular2/platform/browser.dart';

import 'package:hello/app_component.dart';

import 'package:hello/message_service.dart';



void main() {

bootstrap(AppComponent, [MessageService]);

}
import 'package:angular2/core.dart';



@Injectable()

class MessageService {

String _message = 'Hello message';



String get message => _message;

set message(String value) => _message = value;

}
web/main.dart
lib/message_service.dart
lib/app_component.dart
import 'package:angular2/core.dart';

import 'home_component.dart';



@Component(

selector: 'my-app',

template: '''

<h1>Hello {{name}}</h1>

<my-home></my-home>

''',

directives: const [HomeComponent])

class AppComponent {

var name = ’Angular';

}
ANGULAR DART - CODE SAMPLE
COMPONENT / TEMPLATE / SERVICE
import 'package:angular2/core.dart';

import 'message_service.dart';



@Component(

selector: 'my-home',

templateUrl: 'home_component.html',

)

class HomeComponent implements OnInit {

final MessageService _messageService;



String text = 'This is the about home text';

String message;

List<String> list = ["A", "B", "C"];



HomeComponent(this._messageService);



ngOnInit() => message = this._messageService.message;



String getMessage() => message;

String updateMessage(String newMessage) => _messageService.message = newMessage;

}

lib/home_component.dart lib/home_component.html
<h2>{{text}}</h2>

<p>{{getMessage()}}</p>

<li *ngFor="#item of list">

<ul>{{item}}</ul>

</li>

TEMPLATE
ANGULAR DART - TEMPLATE
DATA BINDING - STRINGS
▸ Binds text content to an interpolated string expression

(e.g. function, property, methods…)
▸ <p>Hello {{expression}}</p>
▸ Binds a property to an interpolated string expression
▸ <div title="Hello {{expression}}">
▸ Equivalent to <div [title]="'Hello' + expression">
ANGULAR DART - TEMPLATE
DATA BINDING - PROPERTY / ATTRIBUTE / CLASS / STYLE
▸ Binds property value to the result of expression
▸ <input [value]=“expression">
▸ Binds attribute role to the result of expression
▸ <div [attr.role]="expression">
▸ Binds the presence of the CSS class my-class on the element to the truthiness of the expression
▸ <div [class.my-class]="expression">
▸ Binds style property width to the result of expression expression in pixels. Units are optional.
▸ <div [style.width.px]="expression">
ANGULAR DART - TEMPLATE
DATA BINDING - EVENTS / TWO-WAY DATA BINDING
▸ Calls method onClick when a click event is triggered on this button element (or its
children) and passes in the event object.
▸ <button (click)=“onClick($event)">
▸ Sets up two-way data binding.
▸ <my-cmp [(title)]="name">
▸ Equivalent to <my-cmp [title]="name" (titleChange)="name=$event">





ANGULAR DART - TEMPLATE
DATA BINDING - STRUCTURE
▸ Creates a local variable movieplayer that provides access to the video element instance in data-
binding and event-binding expressions in the current template.
▸ <video #movieplayer ...>

<button (click)="movieplayer.play()">

</video>
▸ The * symbol turns the current element into an embedded template.
▸ <p *myUnless="myExpression">...</p>
▸ Equivalent to <template [myUnless]=“myExpression"><p>...</p></template>
▸ Used by builtin directives such as ngIf, ngFor



ANGULAR DART - TEMPLATE
BUILTIN DIRECTIVES - NGIF / NGFOR
▸ Available using platform_directives in pubspec.yaml
▸ transformers:

- angular2:

platform_directives:

- 'package:angular2/common.dart#COMMON_DIRECTIVES'
▸ Removes or recreates a portion of the DOM tree based on the expression.
▸ <section *ngIf="expression">
▸ Turns the li element and its contents into a template, and uses that to instantiate a view for each item in list.
▸ <li *ngFor="#item of list">
▸ <li *ngFor="let item of list">
▸ Others builtin directives ngSwitch, ngClass, ngStyle, ngTemplateOutlet
COMPONENT
LIFECYCLE HOOKS
ANGULAR DART - COMPONENT LIFECYCLE HOOKS
GOALS
▸ Allow us to perform custom logic at various stages of a component's life
▸ Data isn't always immediately available in the constructor
▸ Implemented as class methods on the Component class
ANGULAR DART - COMPONENT LIFECYCLE HOOKS
LIFECYCLE HOOKS METHODS
▸ ngOnChanges()

Called after every change to input properties and
before processing content or child views.
▸ ngOnInit()

Called after the constructor, initialising input
properties, and after the first call to ngOnChanges.
▸ ngOnDestroy()

Called once, before the instance is destroyed.
▸ ngDoCheck()

Called every time that the input properties of a
component or a directive are checked.

Use it to extend change detection by performing a
custom check.
▸ ngAfterContentInit()

Called after ngOnInit when the component's or
directive's content has been initialized.
▸ ngAfterContentChecked()

Called after every check of the component's or directive's
content.
▸ ngAfterViewInit()

Called after ngAfterContentInit when the component's
view has been initialized. Applies to components only.
▸ ngAfterViewChecked()

Called after every check of the component's view.
Applies to components only.
CODE LABS
ANGULAR DART - CODE LABS
DART + ANGULAR DART - CODE LABS
▸ https://codelabs.developers.google.com/codelabs/ng2-dart
▸ Errata
▸ Step 8
const _namesPath = 'https://www.dartlang.org/f/piratenames.json';
▸ Build & Deploy for production
▸ $ pub build
COMMUNITY
ANGULAR DART - COMMUNITY
EVENTS
▸ Dart Events

https://events.dartlang.org
▸ Dart Developper Summit

https://events.dartlang.org/2016/summit/

https://www.youtube.com/playlist?list=PLOU2XLYxmsILKY-
A1kq4eHMcku3GMAyp2
▸ Meetup Luxembourg Dart Lang

https://www.meetup.com/Luxembourg-Dart-Lang-Meetup/
ANGULAR DART - COMMUNITY
USEFUL LINKS
▸ AngularDart website https://webdev.dartlang.org/
▸ Questions on StackOverflow http://stackoverflow.com/tags/angular-dart
▸ Chat on Gitter https://gitter.im/dart-lang/angular2
▸ Source code on Github https://github.com/dart-lang/angular2
Q&A
AngularDart - Meetup 15/03/2017

More Related Content

What's hot

HTTP APIs as first class procedures in your language: cutting out SDK complex...
HTTP APIs as first class procedures in your language: cutting out SDK complex...HTTP APIs as first class procedures in your language: cutting out SDK complex...
HTTP APIs as first class procedures in your language: cutting out SDK complex...ProgrammableWeb
 
Nagios Conference 2012 - Nathan Vonnahme - Writing Custom Nagios Plugins in Perl
Nagios Conference 2012 - Nathan Vonnahme - Writing Custom Nagios Plugins in PerlNagios Conference 2012 - Nathan Vonnahme - Writing Custom Nagios Plugins in Perl
Nagios Conference 2012 - Nathan Vonnahme - Writing Custom Nagios Plugins in PerlNagios
 
Ethiopian multiplication in Perl6
Ethiopian multiplication in Perl6Ethiopian multiplication in Perl6
Ethiopian multiplication in Perl6Workhorse Computing
 
Replacing "exec" with a type and provider: Return manifests to a declarative ...
Replacing "exec" with a type and provider: Return manifests to a declarative ...Replacing "exec" with a type and provider: Return manifests to a declarative ...
Replacing "exec" with a type and provider: Return manifests to a declarative ...Puppet
 
Lesson 9. The Apache Web Server
Lesson 9. The Apache Web ServerLesson 9. The Apache Web Server
Lesson 9. The Apache Web Serverwebhostingguy
 
Challenges of container configuration
Challenges of container configurationChallenges of container configuration
Challenges of container configurationlutter
 
PM : code faster
PM : code fasterPM : code faster
PM : code fasterPHPPRO
 
PuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with PuppetPuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with PuppetWalter Heck
 
Configuring Django projects for multiple environments
Configuring Django projects for multiple environmentsConfiguring Django projects for multiple environments
Configuring Django projects for multiple environmentsApptension
 
Scala for scripting
Scala for scriptingScala for scripting
Scala for scriptingday
 
#PDR15 Creating Pebble Apps for Aplite, Basalt, and Chalk
#PDR15 Creating Pebble Apps for Aplite, Basalt, and Chalk#PDR15 Creating Pebble Apps for Aplite, Basalt, and Chalk
#PDR15 Creating Pebble Apps for Aplite, Basalt, and ChalkPebble Technology
 
How we use and deploy Varnish at Opera
How we use and deploy Varnish at OperaHow we use and deploy Varnish at Opera
How we use and deploy Varnish at OperaCosimo Streppone
 
Introduction to Node js for beginners + game project
Introduction to Node js for beginners + game projectIntroduction to Node js for beginners + game project
Introduction to Node js for beginners + game projectLaurence Svekis ✔
 
Puppet Camp Chicago 2014: Smoothing Troubles With Custom Types and Providers ...
Puppet Camp Chicago 2014: Smoothing Troubles With Custom Types and Providers ...Puppet Camp Chicago 2014: Smoothing Troubles With Custom Types and Providers ...
Puppet Camp Chicago 2014: Smoothing Troubles With Custom Types and Providers ...Puppet
 
httpd — Apache Web Server
httpd — Apache Web Serverhttpd — Apache Web Server
httpd — Apache Web Serverwebhostingguy
 
Docker meetup - PaaS interoperability
Docker meetup - PaaS interoperabilityDocker meetup - PaaS interoperability
Docker meetup - PaaS interoperabilityLudovic Piot
 
An introduction to Apache Thrift
An introduction to Apache ThriftAn introduction to Apache Thrift
An introduction to Apache ThriftMike Frampton
 

What's hot (20)

HTTP APIs as first class procedures in your language: cutting out SDK complex...
HTTP APIs as first class procedures in your language: cutting out SDK complex...HTTP APIs as first class procedures in your language: cutting out SDK complex...
HTTP APIs as first class procedures in your language: cutting out SDK complex...
 
Nagios Conference 2012 - Nathan Vonnahme - Writing Custom Nagios Plugins in Perl
Nagios Conference 2012 - Nathan Vonnahme - Writing Custom Nagios Plugins in PerlNagios Conference 2012 - Nathan Vonnahme - Writing Custom Nagios Plugins in Perl
Nagios Conference 2012 - Nathan Vonnahme - Writing Custom Nagios Plugins in Perl
 
Ethiopian multiplication in Perl6
Ethiopian multiplication in Perl6Ethiopian multiplication in Perl6
Ethiopian multiplication in Perl6
 
Replacing "exec" with a type and provider: Return manifests to a declarative ...
Replacing "exec" with a type and provider: Return manifests to a declarative ...Replacing "exec" with a type and provider: Return manifests to a declarative ...
Replacing "exec" with a type and provider: Return manifests to a declarative ...
 
Lesson 9. The Apache Web Server
Lesson 9. The Apache Web ServerLesson 9. The Apache Web Server
Lesson 9. The Apache Web Server
 
Challenges of container configuration
Challenges of container configurationChallenges of container configuration
Challenges of container configuration
 
PM : code faster
PM : code fasterPM : code faster
PM : code faster
 
#PDR15 - Pebble Graphics
#PDR15 - Pebble Graphics#PDR15 - Pebble Graphics
#PDR15 - Pebble Graphics
 
PuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with PuppetPuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with Puppet
 
Becoming a Git Master
Becoming a Git MasterBecoming a Git Master
Becoming a Git Master
 
Linux networking
Linux networkingLinux networking
Linux networking
 
Configuring Django projects for multiple environments
Configuring Django projects for multiple environmentsConfiguring Django projects for multiple environments
Configuring Django projects for multiple environments
 
Scala for scripting
Scala for scriptingScala for scripting
Scala for scripting
 
#PDR15 Creating Pebble Apps for Aplite, Basalt, and Chalk
#PDR15 Creating Pebble Apps for Aplite, Basalt, and Chalk#PDR15 Creating Pebble Apps for Aplite, Basalt, and Chalk
#PDR15 Creating Pebble Apps for Aplite, Basalt, and Chalk
 
How we use and deploy Varnish at Opera
How we use and deploy Varnish at OperaHow we use and deploy Varnish at Opera
How we use and deploy Varnish at Opera
 
Introduction to Node js for beginners + game project
Introduction to Node js for beginners + game projectIntroduction to Node js for beginners + game project
Introduction to Node js for beginners + game project
 
Puppet Camp Chicago 2014: Smoothing Troubles With Custom Types and Providers ...
Puppet Camp Chicago 2014: Smoothing Troubles With Custom Types and Providers ...Puppet Camp Chicago 2014: Smoothing Troubles With Custom Types and Providers ...
Puppet Camp Chicago 2014: Smoothing Troubles With Custom Types and Providers ...
 
httpd — Apache Web Server
httpd — Apache Web Serverhttpd — Apache Web Server
httpd — Apache Web Server
 
Docker meetup - PaaS interoperability
Docker meetup - PaaS interoperabilityDocker meetup - PaaS interoperability
Docker meetup - PaaS interoperability
 
An introduction to Apache Thrift
An introduction to Apache ThriftAn introduction to Apache Thrift
An introduction to Apache Thrift
 

Similar to AngularDart - Meetup 15/03/2017

Angular JS2 Training Session #2
Angular JS2 Training Session #2Angular JS2 Training Session #2
Angular JS2 Training Session #2Paras Mendiratta
 
From Zero to Cloud in 12 Easy Factors
From Zero to Cloud in 12 Easy FactorsFrom Zero to Cloud in 12 Easy Factors
From Zero to Cloud in 12 Easy FactorsEd King
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!David Gibbons
 
Android 102 - Flow, Layouts and other things
Android 102 - Flow, Layouts and other thingsAndroid 102 - Flow, Layouts and other things
Android 102 - Flow, Layouts and other thingsKai Koenig
 
Symfony2 - from the trenches
Symfony2 - from the trenchesSymfony2 - from the trenches
Symfony2 - from the trenchesLukas Smith
 
AngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get startedAngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get startedStéphane Bégaudeau
 
Angular presentation
Angular presentationAngular presentation
Angular presentationMatus Szabo
 
How AngularDart & Firebase did an App together
How AngularDart & Firebase did an App togetherHow AngularDart & Firebase did an App together
How AngularDart & Firebase did an App togetherJana Moudrá
 
Angular View Encapsulation
Angular View EncapsulationAngular View Encapsulation
Angular View EncapsulationJennifer Estrada
 
Angular performance slides
Angular performance slidesAngular performance slides
Angular performance slidesDavid Barreto
 
Front end development with Angular JS
Front end development with Angular JSFront end development with Angular JS
Front end development with Angular JSBipin
 
Web Applications with AngularJS
Web Applications with AngularJSWeb Applications with AngularJS
Web Applications with AngularJSPhilipp Burgmer
 
Symfony2 from the Trenches
Symfony2 from the TrenchesSymfony2 from the Trenches
Symfony2 from the TrenchesJonathan Wage
 
Practical AngularJS
Practical AngularJSPractical AngularJS
Practical AngularJSWei Ru
 

Similar to AngularDart - Meetup 15/03/2017 (20)

Angular JS2 Training Session #2
Angular JS2 Training Session #2Angular JS2 Training Session #2
Angular JS2 Training Session #2
 
Introduction to angular js
Introduction to angular jsIntroduction to angular js
Introduction to angular js
 
From Zero to Cloud in 12 Easy Factors
From Zero to Cloud in 12 Easy FactorsFrom Zero to Cloud in 12 Easy Factors
From Zero to Cloud in 12 Easy Factors
 
code-camp-meteor
code-camp-meteorcode-camp-meteor
code-camp-meteor
 
Angular2 + rxjs
Angular2 + rxjsAngular2 + rxjs
Angular2 + rxjs
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!
 
Android 102 - Flow, Layouts and other things
Android 102 - Flow, Layouts and other thingsAndroid 102 - Flow, Layouts and other things
Android 102 - Flow, Layouts and other things
 
AngularJs Crash Course
AngularJs Crash CourseAngularJs Crash Course
AngularJs Crash Course
 
Symfony2 - from the trenches
Symfony2 - from the trenchesSymfony2 - from the trenches
Symfony2 - from the trenches
 
AngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get startedAngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get started
 
Droidcon Paris 2015
Droidcon Paris 2015Droidcon Paris 2015
Droidcon Paris 2015
 
Angular presentation
Angular presentationAngular presentation
Angular presentation
 
How AngularDart & Firebase did an App together
How AngularDart & Firebase did an App togetherHow AngularDart & Firebase did an App together
How AngularDart & Firebase did an App together
 
Angular View Encapsulation
Angular View EncapsulationAngular View Encapsulation
Angular View Encapsulation
 
Basics of AngularJS
Basics of AngularJSBasics of AngularJS
Basics of AngularJS
 
Angular performance slides
Angular performance slidesAngular performance slides
Angular performance slides
 
Front end development with Angular JS
Front end development with Angular JSFront end development with Angular JS
Front end development with Angular JS
 
Web Applications with AngularJS
Web Applications with AngularJSWeb Applications with AngularJS
Web Applications with AngularJS
 
Symfony2 from the Trenches
Symfony2 from the TrenchesSymfony2 from the Trenches
Symfony2 from the Trenches
 
Practical AngularJS
Practical AngularJSPractical AngularJS
Practical AngularJS
 

More from Stéphane Este-Gracias

HashiTalks France 2023 - Sécurisez la distribution automatique de vos certif...
HashiTalks France 2023 - Sécurisez la distribution automatique de vos certif...HashiTalks France 2023 - Sécurisez la distribution automatique de vos certif...
HashiTalks France 2023 - Sécurisez la distribution automatique de vos certif...Stéphane Este-Gracias
 
Discover Dart(lang) - Meetup 07/12/2016
Discover Dart(lang) - Meetup 07/12/2016Discover Dart(lang) - Meetup 07/12/2016
Discover Dart(lang) - Meetup 07/12/2016Stéphane Este-Gracias
 

More from Stéphane Este-Gracias (9)

HashiTalks France 2023 - Sécurisez la distribution automatique de vos certif...
HashiTalks France 2023 - Sécurisez la distribution automatique de vos certif...HashiTalks France 2023 - Sécurisez la distribution automatique de vos certif...
HashiTalks France 2023 - Sécurisez la distribution automatique de vos certif...
 
20221130 - Luxembourg HUG Meetup
20221130 - Luxembourg HUG Meetup20221130 - Luxembourg HUG Meetup
20221130 - Luxembourg HUG Meetup
 
20220928 - Luxembourg HUG Meetup
20220928 - Luxembourg HUG Meetup20220928 - Luxembourg HUG Meetup
20220928 - Luxembourg HUG Meetup
 
20220202 - Luxembourg HUG Meetup
20220202 - Luxembourg HUG Meetup20220202 - Luxembourg HUG Meetup
20220202 - Luxembourg HUG Meetup
 
20220608 - Luxembourg HUG Meetup
20220608 - Luxembourg HUG Meetup20220608 - Luxembourg HUG Meetup
20220608 - Luxembourg HUG Meetup
 
Shift your Workspaces to the Cloud
Shift your Workspaces to the CloudShift your Workspaces to the Cloud
Shift your Workspaces to the Cloud
 
Discover Angular - Meetup 15/02/2017
Discover Angular - Meetup 15/02/2017Discover Angular - Meetup 15/02/2017
Discover Angular - Meetup 15/02/2017
 
Discover Flutter - Meetup 07/12/2016
Discover Flutter - Meetup 07/12/2016Discover Flutter - Meetup 07/12/2016
Discover Flutter - Meetup 07/12/2016
 
Discover Dart(lang) - Meetup 07/12/2016
Discover Dart(lang) - Meetup 07/12/2016Discover Dart(lang) - Meetup 07/12/2016
Discover Dart(lang) - Meetup 07/12/2016
 

Recently uploaded

%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfryanfarris8
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedDelhi Call girls
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456KiaraTiradoMicha
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxalwaysnagaraju26
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...kalichargn70th171
 

Recently uploaded (20)

%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 

AngularDart - Meetup 15/03/2017

  • 4. ANGULAR DART - INTRODUCTION ANGULAR DART: ORIGINS ▸ Open Source Software under a MIT license ▸ Mainly developed by Google engineers ▸ Pitfall and best practices from AngularJS 1.x ▸ AngularDart 1.5 was the sandbox for AngularJS/Dart 2.x ▸ AngularDart 2.x now
  • 5. ANGULAR DART - INTRODUCTION ANGULAR DART: GOALS ▸ Help developers build ▸ Web Applications ▸ Productivity ▸ Write less code
 Google teams report 2x productivity ▸ Performance ▸ Stability
  • 7. ANGULAR DART - GETTING STARTED INSTALL ANGULAR DART ON YOUR FAVORITE PLATFORM ▸ Install Dart on MacOS, Linux Ubuntu/Debian, Windows ▸ Install an IDE ▸ Recommended: WebStorm ▸ Dart Plugins available for ▸ Atom, Sublime Text 3, Visual Studio Code, Emacs, Vim
  • 9. ANGULAR DART - OVERVIEW SYMBOLS ▸ () parentheses ▸ [] square brackets ▸ {} curly brackets ▸ <> angle brackets ▸ {{}} moustache
  • 10. ANGULAR DART - OVERVIEW DART’S WEB STACK ANGULAR DART COMPONENTS ANGULAR DART DART CORE LIBRARIES DART ECOSYSTEM DART LANGUAGE
  • 11. ANGULAR DART - OVERVIEW BUILDING BLOCKS (1/2)
  • 12. ANGULAR DART - OVERVIEW BUILDING BLOCKS (2/2) ▸ Module ▸ Metadata / Annotation / Decorator ▸ Template ▸ Directive ▸ View ▸ Component ▸ Data Binding ▸ Service ▸ Dependency Injection ▸ Injector ▸ Provider ▸ Bootstrapping
  • 13. ANGULAR DART - OVERVIEW MODULE ▸ Module refers to a Dart compilation unit ▸ Library (i.e. set of files in your application package) ▸ If Dart file has no library or part directive, then that file itself is a library ▸ Package (i.e. shared set of libraries) ▸ e.g. angular2, angular2_components packages
  • 14. ANGULAR DART - OVERVIEW METADATA / ANNOTATION / DECORATOR ▸ Metadata refers to a Dart metadata annotation ▸ Begins with the character @ ▸ Followed by either a reference to ▸ a compile-time constant such as
 Component, Directive, Input, Output… ▸ or a call to a constant constructor ▸ Metadata tells Angular how to process the annotated item
  • 15. ANGULAR DART - OVERVIEW DIRECTIVE ▸ Template are dynamic. Angular transforms the DOM
 according to the instructions given by directives ▸ Directive is a Dart class with @Directive annotation ▸ There are three kinds of directives in Angular: ▸ Components with @Component annotation are building blocks of an Angular application ▸ Attribute directives change the appearance or behaviour of a DOM element ▸ Structural directives alter layout by adding, removing, and replacing elements in DOM
  • 16. ANGULAR DART - OVERVIEW VIEW ▸ View is a portion of the screen that ▸ Displays information ▸ Responds to user actions such as clicks, mouse moves and keystrokes ▸ Contains other views ▸ Angular renders a view under the control of one or more Directives ▸ Often convenient to refer to a Component as a View ▸ Any Views might be loaded and unloaded dynamically ▸ Typically under the control of a router
  • 17. ANGULAR DART - OVERVIEW COMPONENT ▸ Directive with an embedded view are called Component ▸ Component is a Dart class with @Component annotation ▸ So it’s a dart class responsible for ▸ Exposing data to a view ▸ Handling most of the view’s display ▸ Handling user-interaction logic ▸ Can be built with input parameters identified with @Input annotation on property type ▸ Can emit event identified with @Output annotation on event’s property ▸ Similar to “controller” or “view-model” in MVC / MVVM design pattern
  • 18. ANGULAR DART - OVERVIEW TEMPLATE ▸ Template is a chunk of HTML that includes ▸ Data bindings ▸ Directives ▸ Other Components
  • 19. ANGULAR DART - OVERVIEW DATA BINDING ▸ Data binding enables ▸ Data to flow from 
 Component to DOM and vice-versa ▸ Possible data bindings are ▸ Interpolation ▸ Property / Event / Attribute / Class / Style binding ▸ Two-way data binding
  • 20. ANGULAR DART - OVERVIEW SERVICE ▸ Service is a class with a focused purpose ▸ Separates data and/or logic from Views or Components ▸ Encapsulates any value, function, or feature that your application needs ▸ e.g. logging service, data service, application configuration…
  • 21. ANGULAR DART - OVERVIEW DEPENDANCY INJECTION (DI) ▸ Supplies instance of a class with fully-formed “dependencies” ▸ A Provider is a recipe for creating new instances of a “dependency” ▸ An Injector maintains a cache of previously created service instances ▸ To use DI, register the Provider’s “dependency” ▸ when bootstrapping the Application ▸ or in the Component metadata
  • 22. ANGULAR DART - OVERVIEW BOOTSTRAPPING ▸ Bootstrapping consists on ▸ An application's top level "root" Component
 i.e. first Component that is loaded for the application
 by convention, AppComponent ▸ and optionally registers service Providers with DI
  • 23. ANGULAR DART - OVERVIEW OTHERS ▸ Template expression ▸ Pipes ▸ Router ▸ Routing component, RouterOutlet ▸ …
  • 24. ANGULAR DART - OVERVIEW WRAP UP ANGULAR DART COMPONENTS ANGULAR DART DART CORE LIBRARIES DART ECOSYSTEM DART LANGUAGE
  • 26. ANGULAR DART - CODE SAMPLE REMINDER: NOTATIONS ▸ PascalCase ▸ Class names (e.g. AppComponent) ▸ camelCase ▸ Function, property, and method names (e.g. ngOnInit, updateMessage) ▸ snake_case ▸ Dart package names and filenames (e.g. my_app / app_component.dart) ▸ dash-case ▸ Directive selectors (e.g. my-app)
  • 27. ANGULAR DART - OVERVIEW COMPONENT / TEMPLATE / DIRECTIVE / BOOTSTRAP / ROOT INJECTOR / SERVICE import 'package:angular2/platform/browser.dart';
 import 'package:hello/app_component.dart';
 import 'package:hello/message_service.dart';
 
 void main() {
 bootstrap(AppComponent, [MessageService]);
 } import 'package:angular2/core.dart';
 
 @Injectable()
 class MessageService {
 String _message = 'Hello message';
 
 String get message => _message;
 set message(String value) => _message = value;
 } web/main.dart lib/message_service.dart lib/app_component.dart import 'package:angular2/core.dart';
 import 'home_component.dart';
 
 @Component(
 selector: 'my-app',
 template: '''
 <h1>Hello {{name}}</h1>
 <my-home></my-home>
 ''',
 directives: const [HomeComponent])
 class AppComponent {
 var name = ’Angular';
 }
  • 28. ANGULAR DART - CODE SAMPLE COMPONENT / TEMPLATE / SERVICE import 'package:angular2/core.dart';
 import 'message_service.dart';
 
 @Component(
 selector: 'my-home',
 templateUrl: 'home_component.html',
 )
 class HomeComponent implements OnInit {
 final MessageService _messageService;
 
 String text = 'This is the about home text';
 String message;
 List<String> list = ["A", "B", "C"];
 
 HomeComponent(this._messageService);
 
 ngOnInit() => message = this._messageService.message;
 
 String getMessage() => message;
 String updateMessage(String newMessage) => _messageService.message = newMessage;
 }
 lib/home_component.dart lib/home_component.html <h2>{{text}}</h2>
 <p>{{getMessage()}}</p>
 <li *ngFor="#item of list">
 <ul>{{item}}</ul>
 </li>

  • 30. ANGULAR DART - TEMPLATE DATA BINDING - STRINGS ▸ Binds text content to an interpolated string expression
 (e.g. function, property, methods…) ▸ <p>Hello {{expression}}</p> ▸ Binds a property to an interpolated string expression ▸ <div title="Hello {{expression}}"> ▸ Equivalent to <div [title]="'Hello' + expression">
  • 31. ANGULAR DART - TEMPLATE DATA BINDING - PROPERTY / ATTRIBUTE / CLASS / STYLE ▸ Binds property value to the result of expression ▸ <input [value]=“expression"> ▸ Binds attribute role to the result of expression ▸ <div [attr.role]="expression"> ▸ Binds the presence of the CSS class my-class on the element to the truthiness of the expression ▸ <div [class.my-class]="expression"> ▸ Binds style property width to the result of expression expression in pixels. Units are optional. ▸ <div [style.width.px]="expression">
  • 32. ANGULAR DART - TEMPLATE DATA BINDING - EVENTS / TWO-WAY DATA BINDING ▸ Calls method onClick when a click event is triggered on this button element (or its children) and passes in the event object. ▸ <button (click)=“onClick($event)"> ▸ Sets up two-way data binding. ▸ <my-cmp [(title)]="name"> ▸ Equivalent to <my-cmp [title]="name" (titleChange)="name=$event">
 
 

  • 33. ANGULAR DART - TEMPLATE DATA BINDING - STRUCTURE ▸ Creates a local variable movieplayer that provides access to the video element instance in data- binding and event-binding expressions in the current template. ▸ <video #movieplayer ...>
 <button (click)="movieplayer.play()">
 </video> ▸ The * symbol turns the current element into an embedded template. ▸ <p *myUnless="myExpression">...</p> ▸ Equivalent to <template [myUnless]=“myExpression"><p>...</p></template> ▸ Used by builtin directives such as ngIf, ngFor
 

  • 34. ANGULAR DART - TEMPLATE BUILTIN DIRECTIVES - NGIF / NGFOR ▸ Available using platform_directives in pubspec.yaml ▸ transformers:
 - angular2:
 platform_directives:
 - 'package:angular2/common.dart#COMMON_DIRECTIVES' ▸ Removes or recreates a portion of the DOM tree based on the expression. ▸ <section *ngIf="expression"> ▸ Turns the li element and its contents into a template, and uses that to instantiate a view for each item in list. ▸ <li *ngFor="#item of list"> ▸ <li *ngFor="let item of list"> ▸ Others builtin directives ngSwitch, ngClass, ngStyle, ngTemplateOutlet
  • 36. ANGULAR DART - COMPONENT LIFECYCLE HOOKS GOALS ▸ Allow us to perform custom logic at various stages of a component's life ▸ Data isn't always immediately available in the constructor ▸ Implemented as class methods on the Component class
  • 37. ANGULAR DART - COMPONENT LIFECYCLE HOOKS LIFECYCLE HOOKS METHODS ▸ ngOnChanges()
 Called after every change to input properties and before processing content or child views. ▸ ngOnInit()
 Called after the constructor, initialising input properties, and after the first call to ngOnChanges. ▸ ngOnDestroy()
 Called once, before the instance is destroyed. ▸ ngDoCheck()
 Called every time that the input properties of a component or a directive are checked.
 Use it to extend change detection by performing a custom check. ▸ ngAfterContentInit()
 Called after ngOnInit when the component's or directive's content has been initialized. ▸ ngAfterContentChecked()
 Called after every check of the component's or directive's content. ▸ ngAfterViewInit()
 Called after ngAfterContentInit when the component's view has been initialized. Applies to components only. ▸ ngAfterViewChecked()
 Called after every check of the component's view. Applies to components only.
  • 39. ANGULAR DART - CODE LABS DART + ANGULAR DART - CODE LABS ▸ https://codelabs.developers.google.com/codelabs/ng2-dart ▸ Errata ▸ Step 8 const _namesPath = 'https://www.dartlang.org/f/piratenames.json'; ▸ Build & Deploy for production ▸ $ pub build
  • 41. ANGULAR DART - COMMUNITY EVENTS ▸ Dart Events
 https://events.dartlang.org ▸ Dart Developper Summit
 https://events.dartlang.org/2016/summit/
 https://www.youtube.com/playlist?list=PLOU2XLYxmsILKY- A1kq4eHMcku3GMAyp2 ▸ Meetup Luxembourg Dart Lang
 https://www.meetup.com/Luxembourg-Dart-Lang-Meetup/
  • 42. ANGULAR DART - COMMUNITY USEFUL LINKS ▸ AngularDart website https://webdev.dartlang.org/ ▸ Questions on StackOverflow http://stackoverflow.com/tags/angular-dart ▸ Chat on Gitter https://gitter.im/dart-lang/angular2 ▸ Source code on Github https://github.com/dart-lang/angular2
  • 43. Q&A