SlideShare a Scribd company logo
AngularJS
SUPERHEROIC JAVASCRIPT MVW FRAMEWORK
Angular JS deep dive
What is it?
Really big JavaScript file
JavaScript MVC framework (or MVW)
HTML syntax extensions
<html>
<script src=“angular.js“></script>
<script src=“app.js“></script>
<body ng-app=“myApp" ng-controller=“myController">
<h1>Sta se jede</h1>
<table>
<tr ng-repeat=“rest in restaurants">
<td>{{rest.name}}</td>
<td>{{rest.score}}</td>
</tr>
</table>
</body>
<html>
angular.module(‘myApp', []).
controller(‘myController‘, function($scope)
{
$scope.restaurants = [
{name:”Sparka”,score:”4/5” },
{name:”NijeSparka”,score:”3/5” }];
});
What is your app made of?
◦ Templates
◦ Expressions
◦ Controllers
◦ Model/Scope
◦ Modules
◦ Services
◦ Directives
◦ Filters
Templates
HTML extended with directives and expressions.
Angular “compiler” renderers DOM aka ”View” for Template.
ng-app minimum for angular to work. <html>
<script src=“angular.js“></script>
<script src=“app.js“></script>
<body ng-app=“myApp" ng-controller=“myController">
<h1>Sta se jede</h1>
<table>
<tr ng-repeat=“rest in restaurants">
<td>{{rest.name}}</td>
<td>{{rest.score}}</td>
</tr>
</table>
</body>
<html>
Controller and $scope
Controller is model/scope constructor
Model != $scope
$scope is an execution context for expressions
$scope functions:
◦ $watch
◦ $apply
Modules
Reusable container of app features.
Info about all other modules that this module depends on.
Angular injector is responsible for construction and lookup of dependencies.
Services
View independent logic
Built in:
◦ $http
◦ $location
◦ $timeout
◦ $filter
◦ $q
◦ …
Directives
HTML extensions in templates
Adding special behavior to custom elements attributes or classes
Built in:
◦ ng-app
◦ ng-controller
◦ ng-click
◦ ng-model
◦ ng-show
◦ …
Filters
Value formatters
Can be used in templates, controllers or services
Custom filters
{{ 12 | currency }} //12$
Performance
Lots of watchers can lag the ui (more then 2000)
Every expression {{}}, every directive is new watcher
ng-repeat instances new template/scope for each item
bindonce in 1.3
Alternatives?
Knockout.js/Backbone.js/Ember.js/React.js
Metric AngularJS Backbone.js Ember.js
Stars on Github 27.2k 18.8k 11k
Third-Party Modules 800 ngmodules 236 backplugs 21 emberaddons
StackOverflow
Questions
49.5k 15.9k 11.2k
YouTube Results ~75k ~16k ~6k
GitHub Contributors 928 230 393
Chrome Extension
Users
150k 7k 38.3k
Community
http://ngmodules.org/
http://angular-ui.github.io/bootstrap/
Angular 2.0
<div ng-controller="SantaTodoController">
<input type="text" ng-model="newTodoTitle">
<button ng-click="addTodo()">+</button>
<tab-container>
<tab-pane title="Tobias">
<div ng-repeat="todo in todosOf('tobias')">
<input type="checkbox“ ng-model="todo.done">
{{todo.title}}
<button ng-click="deleteTodo(todo)">
X
</button>
</div>
</tab-pane>
<div>
<input type=“text” [value]=“newTodoTitle”>
<button (click)=“addTodo()”>+</buton>
<tab-container>
<tab-pane title=“Good kids”>
<div [ng-repeat|todo]=“todosOf('good')”>
<input type=“checkbox” [checked]="todo.done">
{{todo.title}}
<button (click)="deleteTodo(todo)">
X
</button>
</div>
</tab-pane>
Angular 2.0
Angular 2.0 next year
Angular 1.X will be supported for a year and half after 2.0 comes out.
RIP controllers/$scope, directives, modules.
controllers + template => web components.
directives => component, template, decorative components.
$scope => component.
modules => ES6 modules.
component, services: annotated ES 6 class.
Web components (Polymer).
ES6 (traceur).

More Related Content

PPTX
Dapper performance
PPTX
Advanced .NET Data Access with Dapper
PPTX
Advanced data access with Dapper
PPTX
PPTX
Google cloud datastore driver for Google Apps Script DB abstraction
PDF
Building data flows with Celery and SQLAlchemy
PDF
Integrate Solr with real-time stream processing applications
PPT
Dev411
Dapper performance
Advanced .NET Data Access with Dapper
Advanced data access with Dapper
Google cloud datastore driver for Google Apps Script DB abstraction
Building data flows with Celery and SQLAlchemy
Integrate Solr with real-time stream processing applications
Dev411

What's hot (20)

PDF
Elasticsearch War Stories
ODP
Elasticsearch presentation 1
PDF
아파트 정보를 이용한 ELK stack 활용 - 오근문
PPT
Building a CRM on top of ElasticSearch
PPTX
MongoDB: Comparing WiredTiger In-Memory Engine to Redis
PDF
Elasticsearch for Data Analytics
PPTX
Concurrency Patterns with MongoDB
PDF
Scaling massive elastic search clusters - Rafał Kuć - Sematext
PPTX
MongoDB Chunks - Distribution, Splitting, and Merging
PDF
[AI04] Scaling Machine Learning to Big Data Using SparkML and SparkR
PDF
ElasticES-Hadoop: Bridging the world of Hadoop and Elasticsearch
PDF
Logging for Production Systems in The Container Era
PPTX
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
PDF
Core Data with multiple managed object contexts
PPTX
Elasticsearch 5.0
ODP
Query DSL In Elasticsearch
PDF
High Performance Core Data
ODP
PDF
Spark with Elasticsearch - umd version 2014
PDF
Automating Workflows for Analytics Pipelines
Elasticsearch War Stories
Elasticsearch presentation 1
아파트 정보를 이용한 ELK stack 활용 - 오근문
Building a CRM on top of ElasticSearch
MongoDB: Comparing WiredTiger In-Memory Engine to Redis
Elasticsearch for Data Analytics
Concurrency Patterns with MongoDB
Scaling massive elastic search clusters - Rafał Kuć - Sematext
MongoDB Chunks - Distribution, Splitting, and Merging
[AI04] Scaling Machine Learning to Big Data Using SparkML and SparkR
ElasticES-Hadoop: Bridging the world of Hadoop and Elasticsearch
Logging for Production Systems in The Container Era
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
Core Data with multiple managed object contexts
Elasticsearch 5.0
Query DSL In Elasticsearch
High Performance Core Data
Spark with Elasticsearch - umd version 2014
Automating Workflows for Analytics Pipelines
Ad

Viewers also liked (10)

PPTX
Micro ORM vs Entity Framework
PDF
C# Dynamics in the Wild
PPTX
Introduction to FluentData - The Micro ORM
PPTX
Should you react?
PPTX
Entity Framework 7
PPTX
Entity Framework 7: What's New?
PDF
Deep Dive into AngularJS Javascript Framework
PPTX
MVP Showcase 2015 - Entity Framework 7 - NoORM
PPTX
NuGet Must Haves for LINQ
PDF
Introduction to Simple.Data
Micro ORM vs Entity Framework
C# Dynamics in the Wild
Introduction to FluentData - The Micro ORM
Should you react?
Entity Framework 7
Entity Framework 7: What's New?
Deep Dive into AngularJS Javascript Framework
MVP Showcase 2015 - Entity Framework 7 - NoORM
NuGet Must Haves for LINQ
Introduction to Simple.Data
Ad

Similar to Angular JS deep dive (20)

PPTX
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
PPTX
Angular Js Basics
PPTX
Basics of AngularJS
PPT
AngularJS Mobile Warsaw 20-10-2014
PPTX
Custom directive and scopes
PDF
Introduction to AngularJS
PPTX
Top 10 Mistakes AngularJS Developers Make
PPTX
AngularJs Superheroic JavaScript MVW Framework Services by Miracle Studios
PDF
AngularJS 101 - Everything you need to know to get started
PPTX
AngularJS in 60ish Minutes
PDF
Introduction to angular js
PPTX
AngularJs Workshop SDP December 28th 2014
PPTX
Introduction to single page application with angular js
PPTX
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...
PDF
From Web App Model Design to Production with Wakanda
PDF
Mini-Training: AngularJS
PPTX
Angular1x and Angular 2 for Beginners
PPTX
Valentine with AngularJS
PPTX
angularJs Workshop
PDF
Build your website with angularjs and web apis
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
Angular Js Basics
Basics of AngularJS
AngularJS Mobile Warsaw 20-10-2014
Custom directive and scopes
Introduction to AngularJS
Top 10 Mistakes AngularJS Developers Make
AngularJs Superheroic JavaScript MVW Framework Services by Miracle Studios
AngularJS 101 - Everything you need to know to get started
AngularJS in 60ish Minutes
Introduction to angular js
AngularJs Workshop SDP December 28th 2014
Introduction to single page application with angular js
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...
From Web App Model Design to Production with Wakanda
Mini-Training: AngularJS
Angular1x and Angular 2 for Beginners
Valentine with AngularJS
angularJs Workshop
Build your website with angularjs and web apis

More from Axilis (19)

PDF
Web App Security for Devs
PPTX
React tips
PDF
Configuring SSL on NGNINX and less tricky servers
PPTX
Journey to Microservice architecture via Amazon Lambda
PPTX
Sweet ES2015 (ES6) Taste
PPTX
Quick introduction to zeplin
PPTX
Diving into Node with Express and Mongo
PDF
Node in Real Time - The Beginning
PPTX
Road to Dynamic LINQ - Part 2
PPTX
Road to Dynamic LINQ Part 1
PPTX
.NET Core - Sve što trebate znati
PPTX
Angular Translate
PPTX
NPM, Bower and Gulp Kickstart in Visual Studio
PPTX
Dive Into Swift
PPTX
Python Tools for Visual Studio
PPTX
Python Tools for Visual Studio
PPTX
Wireframing
PPTX
Angular 2.0: Getting ready
PPTX
A brief introduction to Code Review
Web App Security for Devs
React tips
Configuring SSL on NGNINX and less tricky servers
Journey to Microservice architecture via Amazon Lambda
Sweet ES2015 (ES6) Taste
Quick introduction to zeplin
Diving into Node with Express and Mongo
Node in Real Time - The Beginning
Road to Dynamic LINQ - Part 2
Road to Dynamic LINQ Part 1
.NET Core - Sve što trebate znati
Angular Translate
NPM, Bower and Gulp Kickstart in Visual Studio
Dive Into Swift
Python Tools for Visual Studio
Python Tools for Visual Studio
Wireframing
Angular 2.0: Getting ready
A brief introduction to Code Review

Recently uploaded (20)

PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Become an Agentblazer Champion Challenge
PDF
Perfecting Gamer’s Experiences with Performance Testing for Gaming Applicatio...
PPTX
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
PDF
Build Multi-agent using Agent Development Kit
PPTX
Odoo Consulting Services by CandidRoot Solutions
PDF
Comprehensive Salesforce Implementation Services.pdf
PPTX
Materi-Enum-and-Record-Data-Type (1).pptx
PPTX
Presentation of Computer CLASS 2 .pptx
PDF
Emergency Mustering solutions – A Brief overview
PPTX
What to Capture When It Breaks: 16 Artifacts That Reveal Root Causes
PDF
Convert Thunderbird to Outlook into bulk
PDF
Multi-factor Authentication (MFA) requirement for Microsoft 365 Admin Center_...
PDF
Jenkins: An open-source automation server powering CI/CD Automation
PDF
Micromaid: A simple Mermaid-like chart generator for Pharo
PDF
Exploring AI Agents in Process Industries
PPTX
Computer Hardware tool: hand tools, diagnostics, ESD and cleaning tools
PPTX
How a Careem Clone App Allows You to Compete with Large Mobility Brands
PDF
Become an Agentblazer Champion Challenge Kickoff
PPTX
Using Bootstrap to Make Accessible Front-Ends(2).pptx
PTS Company Brochure 2025 (1).pdf.......
Become an Agentblazer Champion Challenge
Perfecting Gamer’s Experiences with Performance Testing for Gaming Applicatio...
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Build Multi-agent using Agent Development Kit
Odoo Consulting Services by CandidRoot Solutions
Comprehensive Salesforce Implementation Services.pdf
Materi-Enum-and-Record-Data-Type (1).pptx
Presentation of Computer CLASS 2 .pptx
Emergency Mustering solutions – A Brief overview
What to Capture When It Breaks: 16 Artifacts That Reveal Root Causes
Convert Thunderbird to Outlook into bulk
Multi-factor Authentication (MFA) requirement for Microsoft 365 Admin Center_...
Jenkins: An open-source automation server powering CI/CD Automation
Micromaid: A simple Mermaid-like chart generator for Pharo
Exploring AI Agents in Process Industries
Computer Hardware tool: hand tools, diagnostics, ESD and cleaning tools
How a Careem Clone App Allows You to Compete with Large Mobility Brands
Become an Agentblazer Champion Challenge Kickoff
Using Bootstrap to Make Accessible Front-Ends(2).pptx

Angular JS deep dive

  • 3. What is it? Really big JavaScript file JavaScript MVC framework (or MVW) HTML syntax extensions <html> <script src=“angular.js“></script> <script src=“app.js“></script> <body ng-app=“myApp" ng-controller=“myController"> <h1>Sta se jede</h1> <table> <tr ng-repeat=“rest in restaurants"> <td>{{rest.name}}</td> <td>{{rest.score}}</td> </tr> </table> </body> <html> angular.module(‘myApp', []). controller(‘myController‘, function($scope) { $scope.restaurants = [ {name:”Sparka”,score:”4/5” }, {name:”NijeSparka”,score:”3/5” }]; });
  • 4. What is your app made of? ◦ Templates ◦ Expressions ◦ Controllers ◦ Model/Scope ◦ Modules ◦ Services ◦ Directives ◦ Filters
  • 5. Templates HTML extended with directives and expressions. Angular “compiler” renderers DOM aka ”View” for Template. ng-app minimum for angular to work. <html> <script src=“angular.js“></script> <script src=“app.js“></script> <body ng-app=“myApp" ng-controller=“myController"> <h1>Sta se jede</h1> <table> <tr ng-repeat=“rest in restaurants"> <td>{{rest.name}}</td> <td>{{rest.score}}</td> </tr> </table> </body> <html>
  • 6. Controller and $scope Controller is model/scope constructor Model != $scope $scope is an execution context for expressions $scope functions: ◦ $watch ◦ $apply
  • 7. Modules Reusable container of app features. Info about all other modules that this module depends on. Angular injector is responsible for construction and lookup of dependencies.
  • 8. Services View independent logic Built in: ◦ $http ◦ $location ◦ $timeout ◦ $filter ◦ $q ◦ …
  • 9. Directives HTML extensions in templates Adding special behavior to custom elements attributes or classes Built in: ◦ ng-app ◦ ng-controller ◦ ng-click ◦ ng-model ◦ ng-show ◦ …
  • 10. Filters Value formatters Can be used in templates, controllers or services Custom filters {{ 12 | currency }} //12$
  • 11. Performance Lots of watchers can lag the ui (more then 2000) Every expression {{}}, every directive is new watcher ng-repeat instances new template/scope for each item bindonce in 1.3
  • 12. Alternatives? Knockout.js/Backbone.js/Ember.js/React.js Metric AngularJS Backbone.js Ember.js Stars on Github 27.2k 18.8k 11k Third-Party Modules 800 ngmodules 236 backplugs 21 emberaddons StackOverflow Questions 49.5k 15.9k 11.2k YouTube Results ~75k ~16k ~6k GitHub Contributors 928 230 393 Chrome Extension Users 150k 7k 38.3k
  • 14. Angular 2.0 <div ng-controller="SantaTodoController"> <input type="text" ng-model="newTodoTitle"> <button ng-click="addTodo()">+</button> <tab-container> <tab-pane title="Tobias"> <div ng-repeat="todo in todosOf('tobias')"> <input type="checkbox“ ng-model="todo.done"> {{todo.title}} <button ng-click="deleteTodo(todo)"> X </button> </div> </tab-pane> <div> <input type=“text” [value]=“newTodoTitle”> <button (click)=“addTodo()”>+</buton> <tab-container> <tab-pane title=“Good kids”> <div [ng-repeat|todo]=“todosOf('good')”> <input type=“checkbox” [checked]="todo.done"> {{todo.title}} <button (click)="deleteTodo(todo)"> X </button> </div> </tab-pane>
  • 15. Angular 2.0 Angular 2.0 next year Angular 1.X will be supported for a year and half after 2.0 comes out. RIP controllers/$scope, directives, modules. controllers + template => web components. directives => component, template, decorative components. $scope => component. modules => ES6 modules. component, services: annotated ES 6 class. Web components (Polymer). ES6 (traceur).

Editor's Notes

  • #3: Sluzbena dokumentacija Module dependencies Directives Filteri
  • #4: Template+controller Animate Resource Route
  • #5: Druga predavanja
  • #6: Index_1.html
  • #7: Index_2.html
  • #8: Index_3.html Dependency info
  • #9: Index_4.html
  • #11: Sort by Filter limit Conferencedashboard
  • #13: Toni/React.js
  • #14: Definirati module dependcies
  • #15: Nezna se jos kad ce izaci nije gotovo Svi osim jednog lika rade na Angularu 2.0