SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Angular 2 in Meteor
PEGGY
2015-09-11
Install Angular 2
 Angular 2 Package
 meteor add shmck:angular2
 TypeScript
 meteor add netanelgilad:angular2-typescript
System.js
 System.js is a module loader built into the shmck:angular2 package. We'll
use it to load our root component.
 Import bootstrap component with System.js
<body>
<p>Nothing here</p>
<script>System.import("client/app");</script>
</body>
Root Component - client/index.html
 A component is a controller with an attached view. Think of it like a brick in
the castle of your app.
 We'll create a root component tag called app. Let's include that
component into our main index.html file:
<body>
<app></app>
<script>System.import("client/app");</script>
</body>
client/app.ts
 First we're importing the dependencies we needed from
angular2/angular2. This is not a folder and file in your directory, but
referring to an alias provided to System.js in the shmck:angular2 package.
 Notice the @ syntax. In Angular 2, these are called Annotations.
import {Component, View, bootstrap} from 'angular2/angular2';
@Component({ selector: 'app' })
@View({ template: "<p>Hello World!</p>" })
class Socially {}
bootstrap(Socially);
templateUrl
 client/app.ts
 client/index.ng.html
import {Component, View, bootstrap} from 'angular2/angular2';
@Component({ selector: 'app' })
@View({ templateUrl: "client/index.ng.html" })
class Socially {}
bootstrap(Socially);
<p>Nothing here {{ 'yet' + '!' }}</p>
View
 The syntax is very easy:
 {{ expression | pipe }} - Angular 2 interpolation,
 #variable – local variables available in the scope of the component. The
variable can be later referred in the component’s template,
 (event) - binding to events of element or directive,
 [property] - binding to properties of element.
 *property - the star means that it is a template
 Ref. http://blog.codeleak.pl/2015/06/angular2hello-world.html
Data in the View
 The *ng-for="party of parties" attribute in the li tag is an Angular repeater
directive.
<div>
<ul>
<li *ng-for="#party of parties"> {{party.name}}
<p>{{party.description}}</p>
</li>
</ul>
</div>
Model and Controller
import {Component, View, NgFor, bootstrap} from 'angular2/angular2';
@Component({ selector: 'app' })
@View({
templateUrl: "client/index.ng.html",
directives: [NgFor] })
class Socially {
constructor () {
this.parties = [
{'name': 'Dubstep-Free Zone', 'description': 'Can we please just for an evening not listen to dubstep.'},
{'name': 'All dubstep all the time', 'description': 'Get it on!'},
{'name': 'Savage lounging', 'description': 'Leisure suit required. And only fiercest manners.'} ];
}
}
bootstrap(Socially);
Use Collection
 Use Meteor Tracker, a reactive wrapper that we will run data when a
change occurs.
 The fat arrow syntax => is also from ES2015, and tells the function to run in
it's parents context.
 model/parties.ts
 client/app.ts
Parties = new Mongo.Collection("parties");
constructor() { this.parties = Parties.find().fetch(); }
Meteor Tracker
 A reactive wrapper that we will run data when a change occurs.
 We will bind it to Angular's change detection system, Zone.js.
class Socially {
constructor () {
Tracker.autorun(zone.bind(() => {
this.parties = Parties.find().fetch();
}));
}
}
Model Driven Forms
 We are binding this.partiesForm here to a Control Group. Think of a control
group as a wrapper for a group of form controls.
export class PartiesForm {
constructor() {
this.partiesForm = new ControlGroup({
name: new Control(''),
description: new Control('')
});
}
<form [ng-form-model]="partiesForm">
<label>Name</label>
<input type="text" ng-control="name">
<label>Description</label>
<input type="text" ng-control="description">
<button>Add</button>
</form>
Two-way Bindings
 Property bindings are used to pass data from the parent to the child, and
event bindings are used to pass data from the child to the parent. So we
can use the two to implement two-way bindings.
 And since this is such a common pattern, Angular provides syntax sugar to
remove the boilerplate.
 Ref. http://victorsavkin.com/post/119943127151/angular-2-template-syntax
<input [ng-model]="todo.text" (ng-model)="todo.text=$event"></input>
<input [(ng-model)]="todo.text"></input>
Router
Router
 Install
 meteor add shmck:angular2-router
import {Component, View, bootstrap} from 'angular2/angular2';
import {routerInjectables, routerDirectives, Router, RouteConfig} from 'angular2/router';
@Component({ selector: 'app' })
@View({
template: '<router-outlet></router-outlet>‘,
Directives: [routerDirectives]
})
@RouteConfig()
class Socially {}
bootstrap(Socially, [routerInjectables]);
Router - 2
 imports from 'angular2/router'
 @RouteConfig() which will specify our routes
 View directives adding routerDirectives, allowing us to communicate with
the view
 inject routerInjectables into the child components
 a location where components will be created, the <router-outlet></router-
outlet>
 declare the base route in index.html (required when using the
HTML5LocationStrategy, rather than the HashLocationStategy)
Configuring Routes - client/app.ts
 as: alias
import {PartiesList} from 'client/parties-list/parties-list';
import {PartyDetails} from 'client/party-details/party-details';
@Component( ... )
@View( ... )
@RouteConfig([
{path: '/', component: PartiesList},
{path: '/party/:partyId', as: 'party-details', component: PartyDetails}
])
Problem
 Event Bubbling
 Clicking elements inside that div won’t trigger the event handler.
 We have to be explicit by adding ^ symbol to our binding
 Ref. http://blog.thoughtram.io/angular/2015/08/11/angular-2-template-syntax-
demystified-part-1.html
<div (click)="statement()">
<div></div>
</div>
<div (^click)="statement()">
<div></div>
</div>
<div (click)="statement()"> </div>
Problem
 Zone.js
 Zone.bind()
Meteor.call("test", function(e, n){
this.result = n;
}) ;
Meteor.call("test", (e, n)=>{
this.result = n;
}) ;
Meteor.call("test", zone.bind((e, n)=>{
this.result = n;
})) ;

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Angular 2 - The Next Framework
Angular 2 - The Next FrameworkAngular 2 - The Next Framework
Angular 2 - The Next Framework
 
Get rid of controllers in angular 1.5.x start using component directives
Get rid of controllers in angular 1.5.x start using component directivesGet rid of controllers in angular 1.5.x start using component directives
Get rid of controllers in angular 1.5.x start using component directives
 
Commit University - Exploring Angular 2
Commit University - Exploring Angular 2Commit University - Exploring Angular 2
Commit University - Exploring Angular 2
 
AngularJS - Services
AngularJS - ServicesAngularJS - Services
AngularJS - Services
 
Angular2
Angular2Angular2
Angular2
 
Understand components in Angular 2
Understand components in Angular 2Understand components in Angular 2
Understand components in Angular 2
 
Async patterns in javascript
Async patterns in javascriptAsync patterns in javascript
Async patterns in javascript
 
Solid angular
Solid angularSolid angular
Solid angular
 
AngularJs presentation
AngularJs presentation AngularJs presentation
AngularJs presentation
 
Angular Workshop_Sarajevo2
Angular Workshop_Sarajevo2Angular Workshop_Sarajevo2
Angular Workshop_Sarajevo2
 
Technozaure - Angular2
Technozaure - Angular2Technozaure - Angular2
Technozaure - Angular2
 
ChtiJUG - Introduction à Angular2
ChtiJUG - Introduction à Angular2ChtiJUG - Introduction à Angular2
ChtiJUG - Introduction à Angular2
 
Modern Web Developement
Modern Web DevelopementModern Web Developement
Modern Web Developement
 
ngNewRouter
ngNewRouterngNewRouter
ngNewRouter
 
Angular modules in depth
Angular modules in depthAngular modules in depth
Angular modules in depth
 
Angular 2.0 - What to expect
Angular 2.0 - What to expectAngular 2.0 - What to expect
Angular 2.0 - What to expect
 
Creating a WYSIWYG Editor with React
Creating a WYSIWYG Editor with ReactCreating a WYSIWYG Editor with React
Creating a WYSIWYG Editor with React
 
Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016
Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016
Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016
 
Upgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.xUpgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.x
 
Angular from Scratch
Angular from ScratchAngular from Scratch
Angular from Scratch
 

Ähnlich wie Peggy angular 2 in meteor

Angular2RoutingSetupByShubham
Angular2RoutingSetupByShubhamAngular2RoutingSetupByShubham
Angular2RoutingSetupByShubham
Shubham Verma
 
Migrating to Angular 2
Migrating to Angular 2Migrating to Angular 2
Migrating to Angular 2
FITC
 
anugula2setupbyshubham
anugula2setupbyshubhamanugula2setupbyshubham
anugula2setupbyshubham
Shubham Verma
 
Evan Schultz - Angular Camp - ng2-redux
Evan Schultz - Angular Camp - ng2-reduxEvan Schultz - Angular Camp - ng2-redux
Evan Schultz - Angular Camp - ng2-redux
Evan Schultz
 

Ähnlich wie Peggy angular 2 in meteor (20)

Angular JS2 Training Session #2
Angular JS2 Training Session #2Angular JS2 Training Session #2
Angular JS2 Training Session #2
 
Building an angular application -1 ( API: Golang, Database: Postgres) v1.0
Building an angular application -1 ( API: Golang, Database: Postgres) v1.0Building an angular application -1 ( API: Golang, Database: Postgres) v1.0
Building an angular application -1 ( API: Golang, Database: Postgres) v1.0
 
Angular2RoutingSetupByShubham
Angular2RoutingSetupByShubhamAngular2RoutingSetupByShubham
Angular2RoutingSetupByShubham
 
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
 
Angular Notes.pdf
Angular Notes.pdfAngular Notes.pdf
Angular Notes.pdf
 
Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6
 
Migrating to Angular 2
Migrating to Angular 2Migrating to Angular 2
Migrating to Angular 2
 
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
 
Exploring Angular 2 - Episode 1
Exploring Angular 2 - Episode 1Exploring Angular 2 - Episode 1
Exploring Angular 2 - Episode 1
 
Angular 2 in-1
Angular 2 in-1 Angular 2 in-1
Angular 2 in-1
 
Angular 2 - a New Hope
Angular 2 - a New HopeAngular 2 - a New Hope
Angular 2 - a New Hope
 
はじめてのAngular2
はじめてのAngular2はじめてのAngular2
はじめてのAngular2
 
Routing to components
Routing to componentsRouting to components
Routing to components
 
mean stack
mean stackmean stack
mean stack
 
هیبرید کارا، از رویا تا واقعیت!
هیبرید کارا، از رویا تا واقعیت!هیبرید کارا، از رویا تا واقعیت!
هیبرید کارا، از رویا تا واقعیت!
 
angular fundamentals.pdf angular fundamentals.pdf
angular fundamentals.pdf angular fundamentals.pdfangular fundamentals.pdf angular fundamentals.pdf
angular fundamentals.pdf angular fundamentals.pdf
 
anugula2setupbyshubham
anugula2setupbyshubhamanugula2setupbyshubham
anugula2setupbyshubham
 
Evan Schultz - Angular Camp - ng2-redux
Evan Schultz - Angular Camp - ng2-reduxEvan Schultz - Angular Camp - ng2-redux
Evan Schultz - Angular Camp - ng2-redux
 
[FEConf Korea 2017]Angular 컴포넌트 대화법
[FEConf Korea 2017]Angular 컴포넌트 대화법[FEConf Korea 2017]Angular 컴포넌트 대화법
[FEConf Korea 2017]Angular 컴포넌트 대화법
 
Angular routing
Angular routingAngular routing
Angular routing
 

Mehr von LearningTech (20)

vim
vimvim
vim
 
PostCss
PostCssPostCss
PostCss
 
ReactJs
ReactJsReactJs
ReactJs
 
Docker
DockerDocker
Docker
 
Semantic ui
Semantic uiSemantic ui
Semantic ui
 
node.js errors
node.js errorsnode.js errors
node.js errors
 
Process control nodejs
Process control nodejsProcess control nodejs
Process control nodejs
 
Expression tree
Expression treeExpression tree
Expression tree
 
SQL 效能調校
SQL 效能調校SQL 效能調校
SQL 效能調校
 
flexbox report
flexbox reportflexbox report
flexbox report
 
Vic weekly learning_20160504
Vic weekly learning_20160504Vic weekly learning_20160504
Vic weekly learning_20160504
 
Reflection &amp; activator
Reflection &amp; activatorReflection &amp; activator
Reflection &amp; activator
 
Peggy markdown
Peggy markdownPeggy markdown
Peggy markdown
 
Node child process
Node child processNode child process
Node child process
 
20160415ken.lee
20160415ken.lee20160415ken.lee
20160415ken.lee
 
Peggy elasticsearch應用
Peggy elasticsearch應用Peggy elasticsearch應用
Peggy elasticsearch應用
 
Expression tree
Expression treeExpression tree
Expression tree
 
Vic weekly learning_20160325
Vic weekly learning_20160325Vic weekly learning_20160325
Vic weekly learning_20160325
 
D3js learning tips
D3js learning tipsD3js learning tips
D3js learning tips
 
git command
git commandgit command
git command
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

Peggy angular 2 in meteor

  • 1. Angular 2 in Meteor PEGGY 2015-09-11
  • 2. Install Angular 2  Angular 2 Package  meteor add shmck:angular2  TypeScript  meteor add netanelgilad:angular2-typescript
  • 3. System.js  System.js is a module loader built into the shmck:angular2 package. We'll use it to load our root component.  Import bootstrap component with System.js <body> <p>Nothing here</p> <script>System.import("client/app");</script> </body>
  • 4. Root Component - client/index.html  A component is a controller with an attached view. Think of it like a brick in the castle of your app.  We'll create a root component tag called app. Let's include that component into our main index.html file: <body> <app></app> <script>System.import("client/app");</script> </body>
  • 5. client/app.ts  First we're importing the dependencies we needed from angular2/angular2. This is not a folder and file in your directory, but referring to an alias provided to System.js in the shmck:angular2 package.  Notice the @ syntax. In Angular 2, these are called Annotations. import {Component, View, bootstrap} from 'angular2/angular2'; @Component({ selector: 'app' }) @View({ template: "<p>Hello World!</p>" }) class Socially {} bootstrap(Socially);
  • 6. templateUrl  client/app.ts  client/index.ng.html import {Component, View, bootstrap} from 'angular2/angular2'; @Component({ selector: 'app' }) @View({ templateUrl: "client/index.ng.html" }) class Socially {} bootstrap(Socially); <p>Nothing here {{ 'yet' + '!' }}</p>
  • 7.
  • 8. View  The syntax is very easy:  {{ expression | pipe }} - Angular 2 interpolation,  #variable – local variables available in the scope of the component. The variable can be later referred in the component’s template,  (event) - binding to events of element or directive,  [property] - binding to properties of element.  *property - the star means that it is a template  Ref. http://blog.codeleak.pl/2015/06/angular2hello-world.html
  • 9. Data in the View  The *ng-for="party of parties" attribute in the li tag is an Angular repeater directive. <div> <ul> <li *ng-for="#party of parties"> {{party.name}} <p>{{party.description}}</p> </li> </ul> </div>
  • 10. Model and Controller import {Component, View, NgFor, bootstrap} from 'angular2/angular2'; @Component({ selector: 'app' }) @View({ templateUrl: "client/index.ng.html", directives: [NgFor] }) class Socially { constructor () { this.parties = [ {'name': 'Dubstep-Free Zone', 'description': 'Can we please just for an evening not listen to dubstep.'}, {'name': 'All dubstep all the time', 'description': 'Get it on!'}, {'name': 'Savage lounging', 'description': 'Leisure suit required. And only fiercest manners.'} ]; } } bootstrap(Socially);
  • 11. Use Collection  Use Meteor Tracker, a reactive wrapper that we will run data when a change occurs.  The fat arrow syntax => is also from ES2015, and tells the function to run in it's parents context.  model/parties.ts  client/app.ts Parties = new Mongo.Collection("parties"); constructor() { this.parties = Parties.find().fetch(); }
  • 12. Meteor Tracker  A reactive wrapper that we will run data when a change occurs.  We will bind it to Angular's change detection system, Zone.js. class Socially { constructor () { Tracker.autorun(zone.bind(() => { this.parties = Parties.find().fetch(); })); } }
  • 13. Model Driven Forms  We are binding this.partiesForm here to a Control Group. Think of a control group as a wrapper for a group of form controls. export class PartiesForm { constructor() { this.partiesForm = new ControlGroup({ name: new Control(''), description: new Control('') }); } <form [ng-form-model]="partiesForm"> <label>Name</label> <input type="text" ng-control="name"> <label>Description</label> <input type="text" ng-control="description"> <button>Add</button> </form>
  • 14. Two-way Bindings  Property bindings are used to pass data from the parent to the child, and event bindings are used to pass data from the child to the parent. So we can use the two to implement two-way bindings.  And since this is such a common pattern, Angular provides syntax sugar to remove the boilerplate.  Ref. http://victorsavkin.com/post/119943127151/angular-2-template-syntax <input [ng-model]="todo.text" (ng-model)="todo.text=$event"></input> <input [(ng-model)]="todo.text"></input>
  • 16. Router  Install  meteor add shmck:angular2-router import {Component, View, bootstrap} from 'angular2/angular2'; import {routerInjectables, routerDirectives, Router, RouteConfig} from 'angular2/router'; @Component({ selector: 'app' }) @View({ template: '<router-outlet></router-outlet>‘, Directives: [routerDirectives] }) @RouteConfig() class Socially {} bootstrap(Socially, [routerInjectables]);
  • 17. Router - 2  imports from 'angular2/router'  @RouteConfig() which will specify our routes  View directives adding routerDirectives, allowing us to communicate with the view  inject routerInjectables into the child components  a location where components will be created, the <router-outlet></router- outlet>  declare the base route in index.html (required when using the HTML5LocationStrategy, rather than the HashLocationStategy)
  • 18. Configuring Routes - client/app.ts  as: alias import {PartiesList} from 'client/parties-list/parties-list'; import {PartyDetails} from 'client/party-details/party-details'; @Component( ... ) @View( ... ) @RouteConfig([ {path: '/', component: PartiesList}, {path: '/party/:partyId', as: 'party-details', component: PartyDetails} ])
  • 19.
  • 20. Problem  Event Bubbling  Clicking elements inside that div won’t trigger the event handler.  We have to be explicit by adding ^ symbol to our binding  Ref. http://blog.thoughtram.io/angular/2015/08/11/angular-2-template-syntax- demystified-part-1.html <div (click)="statement()"> <div></div> </div> <div (^click)="statement()"> <div></div> </div> <div (click)="statement()"> </div>
  • 21. Problem  Zone.js  Zone.bind() Meteor.call("test", function(e, n){ this.result = n; }) ; Meteor.call("test", (e, n)=>{ this.result = n; }) ; Meteor.call("test", zone.bind((e, n)=>{ this.result = n; })) ;