Share
Embed
Transcript
296 slides
-
Backbone.js problems • Application lifecycle • Conventions • Plugin/module system
• Template engine • Subviews handling -
Backbone.js problems • Application lifecycle • Conventions • Plugin/module system
• Template engine • Subviews handling • Routing -
Backbone.js problems • Application lifecycle • Conventions • Plugin/module system
• Template engine • Subviews handling • Routing • Testability -
• Application lifecycle • Conventions • Plugin/module system • Template
engine • Subviews handling • Routing • Testability Недостатъци на Backbone.js -
• Application lifecycle • Conventions • Plugin/module system • Template
engine • Subviews handling • Routing • Testability Недостатъци на Backbone.js Angular -
• Application lifecycle! • Conventions • Plugin/module system • Template
engine • Subviews handling • Routing • Testability Angular -
• Application lifecycle • Conventions • Plugin/module system • Template
engine • Subviews handling • Routing • Testability Angular -
• Application lifecycle • Conventions! • Plugin/module system • Template
engine • Subviews handling • Routing • Testability Angular -
• Application lifecycle • Conventions • Plugin/module system • Template
engine • Subviews handling • Routing • Testability Angular -
• Application lifecycle • Conventions • Plugin/module system! • Template
engine • Subviews handling • Routing • Testability Angular -
(function() { function Product($resource) { return $resource("/api/products/:id", {id: '@id'}); }
! Product.$inject = ['$resource'] ! app.service('Product', Product); })(); -
(function() { function Product($resource) { return $resource("/api/products/:id", {id: '@id'}); }
! Product.$inject = ['$resource'] ! app.service('Product', Product); })(); -
(function() { function Product($resource) { return $resource("/api/products/:id", {id: '@id'}); }
! Product.$inject = ['$resource'] ! app.service('Product', Product); })(); -
(function() { function Product($resource) { return $resource("/api/products/:id", {id: '@id'}); }
! Product.$inject = ['$resource'] ! app.service('Product', Product); })(); -
(function() { function Product($resource) { return $resource("/api/products/:id", {id: '@id'}); }
! Product.$inject = ['$resource'] ! app.service('Product', Product); })(); -
(function() { function Product($resource) { return $resource("/api/products/:id", {id: '@id'}); }
! Product.$inject = ['$resource'] ! app.service('Product', Product); })(); -
(function() { function Product($resource) { return $resource("/api/products/:id", {id: '@id'}); }
! Product.$inject = ['$resource'] ! app.service('Product', Product); })(); -
(function() { function Product($resource) { return $resource("/api/products/:id", {id: '@id'}); }
! Product.$inject = ['$resource'] ! app.service('Product', Product); })(); -
(function() { function Product($resource) { return $resource("/api/products/:id", {id: '@id'}); }
! Product.$inject = ['$resource'] ! app.service('Product', Product); })(); -
app.factory('Person', function($window) { var name = ''; ! return {
setName: function(newName) { name = newName; }, getName: function() { return name; }, say: function(text) { $window.alert(name + ' - ' + text); } } }); -
app.factory('Person', function($window) { var name = ''; ! return {
setName: function(newName) { name = newName; }, getName: function() { return name; }, say: function(text) { $window.alert(name + ' - ' + text); } } }); -
app.factory('Person', function($window) { var name = ''; ! return {
setName: function(newName) { name = newName; }, getName: function() { return name; }, say: function(text) { $window.alert(name + ' - ' + text); } } }); -
app.factory('Person', function($window) { var name = ''; ! return {
setName: function(newName) { name = newName; }, getName: function() { return name; }, say: function(text) { $window.alert(name + ' - ' + text); } } }); -
app.factory('Person', function($window) { var name = ''; ! return {
setName: function(newName) { name = newName; }, getName: function() { return name; }, say: function(text) { $window.alert(name + ' - ' + text); } } }); -
app.factory('Person', function($window) { var name = ''; ! return {
setName: function(newName) { name = newName; }, getName: function() { return name; }, say: function(text) { $window.alert(name + ' - ' + text); } } }); -
app.factory('Person', function($window) { var name = ''; ! return {
setName: function(newName) { name = newName; }, getName: function() { return name; }, say: function(text) { $window.alert(name + ' - ' + text); } } }); -
app.factory('Person', function($window) { var name = ''; ! return {
setName: function(newName) { name = newName; }, getName: function() { return name; }, say: function(text) { $window.alert(name + ' - ' + text); } } }); -
app.factory('Person', function($window) { var name = ''; ! return {
setName: function(newName) { name = newName; }, getName: function() { return name; }, say: function(text) { $window.alert(name + ' - ' + text); } } }); -
app.factory('Person', function($window) { var name = ''; ! return {
setName: function(newName) { name = newName; }, getName: function() { return name; }, say: function(text) { $window.alert(name + ' - ' + text); } } }); -
app.factory('Person', function($window) { var name = ''; ! return {
setName: function(newName) { name = newName; }, getName: function() { return name; }, say: function(text) { $window.alert(name + ' - ' + text); } } }); -
app.factory('Person', function($window) { var name = ''; ! return {
setName: function(newName) { name = newName; }, getName: function() { return name; }, say: function(text) { $window.alert(name + ' - ' + text); } } }); -
app.factory('Person', function($window) { var name = ''; ! return {
setName: function(newName) { name = newName; }, getName: function() { return name; }, say: function(text) { $window.alert(name + ' - ' + text); } } }); -
app.service('Person', function($window) { var name = ''; ! this.setName =
function(newName) { name = newName; }; ! this.getName = function() { return name; }; ! this.say = function(text) { $window.alert(name + ' - ' + text); }; }); -
app.service('Person', function($window) { var name = ''; ! this.setName =
function(newName) { name = newName; }; ! this.getName = function() { return name; }; ! this.say = function(text) { $window.alert(name + ' - ' + text); }; }); -
app.service('Person', function($window) { var name = ''; ! this.setName =
function(newName) { name = newName; }; ! this.getName = function() { return name; }; ! this.say = function(text) { $window.alert(name + ' - ' + text); }; }); -
app.service('Person', function($window) { var name = ''; ! this.setName =
function(newName) { name = newName; }; ! this.getName = function() { return name; }; ! this.say = function(text) { $window.alert(name + ' - ' + text); }; }); -
app.service('Person', function($window) { var name = ''; ! this.setName =
function(newName) { name = newName; }; ! this.getName = function() { return name; }; ! this.say = function(text) { $window.alert(name + ' - ' + text); }; }); -
app.provider('Person', function() { this.name = ''; ! this.$get = function($window)
{ var self = this; return { setName: function(newName) { self.name = newName; }, getName: function() { return self.name; }, say: function(text) { $window.alert(self.name + ' - ' + text); } }; } }); -
app.provider('Person', function() { this.name = ''; ! this.$get = function($window)
{ var self = this; return { setName: function(newName) { self.name = newName; }, getName: function() { return self.name; }, say: function(text) { $window.alert(self.name + ' - ' + text); } }; } }); -
app.provider('Person', function() { this.name = ''; ! this.$get = function($window)
{ var self = this; return { setName: function(newName) { self.name = newName; }, getName: function() { return self.name; }, say: function(text) { $window.alert(self.name + ' - ' + text); } }; } }); -
app.provider('Person', function() { this.name = ''; ! this.$get = function($window)
{ var self = this; return { setName: function(newName) { self.name = newName; }, getName: function() { return self.name; }, say: function(text) { $window.alert(self.name + ' - ' + text); } }; } }); -
app.provider('Person', function() { this.name = ''; ! this.$get = function($window)
{ var self = this; return { setName: function(newName) { self.name = newName; }, getName: function() { return self.name; }, say: function(text) { $window.alert(self.name + ' - ' + text); } }; } }); -
app.provider('Person', function() { this.name = ''; ! this.$get = function($window)
{ var self = this; return { setName: function(newName) { self.name = newName; }, getName: function() { return self.name; }, say: function(text) { $window.alert(self.name + ' - ' + text); } }; } }); -
app.provider('Person', function() { this.name = ''; ! this.$get = function($window)
{ var self = this; return { setName: function(newName) { self.name = newName; }, getName: function() { return self.name; }, say: function(text) { $window.alert(self.name + ' - ' + text); } }; } }); -
app.provider('Person', function() { this.name = ''; ! this.$get = function($window)
{ var self = this; return { setName: function(newName) { self.name = newName; }, getName: function() { return self.name; }, say: function(text) { $window.alert(self.name + ' - ' + text); } }; } }); -
app.provider('Person', function() { this.name = ''; ! this.$get = function($window)
{ var self = this; return { setName: function(newName) { self.name = newName; }, getName: function() { return self.name; }, say: function(text) { $window.alert(self.name + ' - ' + text); } }; } }); -
• Application lifecycle • Conventions • Plugin/module system • Template
engine • Subviews handling • Routing • Testability Angular -
• Application lifecycle • Conventions • Plugin/module system • Template
engine! • Subviews handling • Routing • Testability Angular -
<html ng-app> <body> <header> <input type="text" ng-model="value" /> </header> <article>
<p>{{value}}</p> </article> </body> </html> 1 -
<html ng-app> <body> <header> <input type="text" ng-model="value" /> </header> <article>
<p>{{value}}</p> </article> </body> </html> 1 -
<html ng-app> <body> <header> <input type="text" ng-model="value" /> </header> <article>
<p>{{value}}</p> </article> </body> </html> 1 -
<html ng-app> <body> <header> <input type="text" ng-model="value" /> </header> <article>
<p>{{value}}</p> </article> </body> </html> 1 -
<html ng-app> <body> <header> <input type="text" ng-model="value" /> </header> <article>
<p>{{value}}</p> </article> </body> </html> 1 -
<html ng-app> <body> <header> <input type="text" ng-model="value" /> </header> <article>
<p>{{value}}</p> </article> </body> </html> 1 -
<html ng-app> <body> <header> <input type="text" ng-model="value" /> </header> <article>
<p>{{value}}</p> </article> </body> </html> 1 -
<html ng-app="demo"> <body ng-controller="demoCtrl"> <header> <button ng-click="increase();">+</button> <button ng-click="decrease();">-</button> </header>
<article> <p>{{value}}</p> </article> </body> </html> -
<html ng-app="demo"> <body ng-controller="demoCtrl"> <header> <button ng-click="increase();">+</button> <button ng-click="decrease();">-</button> </header>
<article> <p>{{value}}</p> </article> </body> </html> -
<html ng-app="demo"> <body ng-controller="demoCtrl"> <header> <button ng-click="increase();">+</button> <button ng-click="decrease();">-</button> </header>
<article> <p>{{value}}</p> </article> </body> </html> -
<html ng-app="demo"> <body ng-controller="demoCtrl"> <header> <button ng-click="increase();">+</button> <button ng-click="decrease();">-</button> </header>
<article> <p>{{value}}</p> </article> </body> </html> -
<html ng-app="demo"> <body ng-controller="demoCtrl"> <header> <button ng-click="increase();">+</button> <button ng-click="decrease();">-</button> </header>
<article> <p>{{value}}</p> </article> </body> </html> -
<html ng-app="demo"> <body ng-controller="demoCtrl"> <header> <button ng-click="increase();">+</button> <button ng-click="decrease();">-</button> </header>
<article> <p>{{value}}</p> </article> </body> </html> -
<html ng-app="demo"> <body ng-controller="demoCtrl"> <header> <button ng-click="increase();">+</button> <button ng-click="decrease();">-</button> </header>
<article> <p>{{value}}</p> </article> </body> </html> -
<html ng-app="demo"> <body ng-controller="demoCtrl"> <header> <button ng-click="increase();">+</button> <button ng-click="decrease();">-</button> </header>
<article> <p>{{value}}</p> </article> </body> </html> -
<html ng-app="demo"> <body ng-controller="demoCtrl"> <header> <button ng-click="increase();">+</button> <button ng-click="decrease();">-</button> </header>
<article> <p>{{value}}</p> </article> </body> </html> -
app.controller('demoCtrl', function($scope) { $scope.value = 0; $scope.increase = function() {
$scope.value += 1; }; $scope.decrease = function() { $scope.value -= 1; }; }); 2 -
app.controller('demoCtrl', function($scope) { $scope.value = 0; $scope.increase = function() {
$scope.value += 1; }; $scope.decrease = function() { $scope.value -= 1; }; }); 2 -
app.controller('demoCtrl', function($scope) { $scope.value = 0; $scope.increase = function() {
$scope.value += 1; }; $scope.decrease = function() { $scope.value -= 1; }; }); 2 -
app.controller('demoCtrl', function($scope) { $scope.value = 0; $scope.increase = function() {
$scope.value += 1; }; $scope.decrease = function() { $scope.value -= 1; }; }); 2 -
app.controller('demoCtrl', function($scope) { $scope.value = 0; $scope.increase = function() {
$scope.value += 1; }; $scope.decrease = function() { $scope.value -= 1; }; }); 2 -
app.controller('demoCtrl', function($scope) { $scope.value = 0; $scope.increase = function() {
$scope.value += 1; }; $scope.decrease = function() { $scope.value -= 1; }; }); 2 -
app.controller('demoCtrl', function($scope) { $scope.value = 0; $scope.increase = function() {
$scope.value += 1; }; $scope.decrease = function() { $scope.value -= 1; }; }); 2 -
<html ng-app="demo"> <body ng-controller="demoCtrl"> <header> <button ng-click="increase();">+</button> <button ng-click=“decrease();">-</button> </header>
<article> <p>{{value}}</p> </article> </body> </html> -
<html ng-app="demo"> <body> <header ng-controller="actionsCtrl"> <button ng-click="increase();">+</button> <button ng-click=“decrease();">-</button> </header>
<article ng-controller="displayCtrl"> <p>{{calculator.value}}</p> </article> </body> </html> -
<html ng-app="demo"> <body> <header ng-controller="actionsCtrl"> <button ng-click="increase();">+</button> <button ng-click=“decrease();">-</button> </header>
<article ng-controller="displayCtrl"> <p>{{calculator.value}}</p> </article> </body> </html> -
<html ng-app="demo"> <body> <header ng-controller="actionsCtrl"> <button ng-click="increase();">+</button> <button ng-click=“decrease();">-</button> </header>
<article ng-controller="displayCtrl"> <p>{{calculator.value}}</p> </article> </body> </html> -
<html ng-app="demo"> <body> <header ng-controller="actionsCtrl"> <button ng-click="increase();">+</button> <button ng-click=“decrease();">-</button> </header>
<article ng-controller="displayCtrl"> <p>{{calculator.value}}</p> </article> </body> </html> -
<html ng-app="demo"> <body> <header ng-controller="actionsCtrl"> <button ng-click="increase();">+</button> <button ng-click=“decrease();">-</button> </header>
<article ng-controller="displayCtrl"> <p>{{calculator.value}}</p> </article> </body> </html> -
<html ng-app="demo"> <body> <header ng-controller="actionsCtrl"> <button ng-click="increase();">+</button> <button ng-click=“decrease();">-</button> </header>
<article ng-controller="displayCtrl"> <p>{{calculator.value}}</p> </article> </body> </html> -
<html ng-app="demo"> <body> <header ng-controller="actionsCtrl"> <button ng-click="increase();">+</button> <button ng-click=“decrease();">-</button> </header>
<article ng-controller="displayCtrl"> <p>{{calculator.value}}</p> </article> </body> </html> -
app.controller('actionsCtrl', function($scope, Calculator) { $scope.increase = function() { Calculator.value +=
1; }; $scope.decrease = function() { Calculator.value -= 1; }; }); -
app.controller('actionsCtrl', function($scope, Calculator) { $scope.increase = function() { Calculator.value +=
1; }; $scope.decrease = function() { Calculator.value -= 1; }; }); -
app.controller('actionsCtrl', function($scope, Calculator) { $scope.increase = function() { Calculator.value +=
1; }; $scope.decrease = function() { Calculator.value -= 1; }; }); -
app.controller('actionsCtrl', function($scope, Calculator) { $scope.increase = function() { Calculator.value +=
1; }; $scope.decrease = function() { Calculator.value -= 1; }; }); -
app.controller('actionsCtrl', function($scope, Calculator) { $scope.increase = function() { Calculator.value +=
1; }; $scope.decrease = function() { Calculator.value -= 1; }; }); -
app.controller('actionsCtrl', function($scope, Calculator) { $scope.increase = function() { Calculator.value +=
1; }; $scope.decrease = function() { Calculator.value -= 1; }; }); -
app.controller('actionsCtrl', function($scope, Calculator) { $scope.increase = function() { Calculator.value +=
1; }; $scope.decrease = function() { Calculator.value -= 1; }; }); -
• Application lifecycle • Conventions • Plugin/module system • Template
engine • Subviews handling • Routing • Testability Angular -
• Application lifecycle • Conventions • Plugin/module system • Template
engine • Subviews handling! • Routing • Testability Angular -
<body ng-controller="demoCtrl"> <article> <ul> <li ng-repeat="task in tasks">{{task.text}}</li> <li> <form
ng-submit="createTask();"> <input type="text" ng-model="newTask" /> </form> </li> </ul> </article> </body> -
<body ng-controller="demoCtrl"> <article> <ul> <li ng-repeat="task in tasks">{{task.text}}</li> <li> <form
ng-submit="createTask();"> <input type="text" ng-model="newTask" /> </form> </li> </ul> </article> </body> -
<body ng-controller="demoCtrl"> <article> <ul> <li ng-repeat="task in tasks">{{task.text}}</li> <li> <form
ng-submit="createTask();"> <input type="text" ng-model="newTask" /> </form> </li> </ul> </article> </body> -
<body ng-controller="demoCtrl"> <article> <ul> <li ng-repeat="task in tasks">{{task.text}}</li> <li> <form
ng-submit="createTask();"> <input type="text" ng-model="newTask" /> </form> </li> </ul> </article> </body> -
<body ng-controller="demoCtrl"> <article> <ul> <li ng-repeat="task in tasks">{{task.text}}</li> <li> <form
ng-submit="createTask();"> <input type="text" ng-model="newTask" /> </form> </li> </ul> </article> </body> -
<body ng-controller="demoCtrl"> <article> <ul> <li ng-repeat="task in tasks">{{task.text}}</li> <li> <form
ng-submit="createTask();"> <input type="text" ng-model="newTask" /> </form> </li> </ul> </article> </body> -
<body ng-controller="demoCtrl"> <article> <ul> <li ng-repeat="task in tasks">{{task.text}}</li> <li> <form
ng-submit="createTask();"> <input type="text" ng-model="newTask" /> </form> </li> </ul> </article> </body> -
<body ng-controller="demoCtrl"> <article> <ul> <li ng-repeat="task in tasks">{{task.text}}</li> <li> <form
ng-submit="createTask();"> <input type="text" ng-model="newTask" /> </form> </li> </ul> </article> </body> -
<body ng-controller="demoCtrl"> <article> <ul> <li ng-repeat="task in tasks">{{task.text}}</li> <li> <form
ng-submit="createTask();"> <input type="text" ng-model="newTask" /> </form> </li> </ul> </article> </body> -
app.controller('demoCtrl', function($scope) { $scope.tasks = []; $scope.newTask = ""; $scope.createTask
= function() { if ($scope.newTask.length > 0) { $scope.tasks.push({name: $scope.newTask}); $scope.newTask = ""; } }; }); 4 -
app.controller('demoCtrl', function($scope) { $scope.tasks = []; $scope.newTask = ""; $scope.createTask
= function() { if ($scope.newTask.length > 0) { $scope.tasks.push({name: $scope.newTask}); $scope.newTask = ""; } }; }); 4 -
app.controller('demoCtrl', function($scope) { $scope.tasks = []; $scope.newTask = ""; $scope.createTask
= function() { if ($scope.newTask.length > 0) { $scope.tasks.push({name: $scope.newTask}); $scope.newTask = ""; } }; }); 4 -
app.controller('demoCtrl', function($scope) { $scope.tasks = []; $scope.newTask = ""; $scope.createTask
= function() { if ($scope.newTask.length > 0) { $scope.tasks.push({name: $scope.newTask}); $scope.newTask = ""; } }; }); 4 -
app.controller('demoCtrl', function($scope) { $scope.tasks = []; $scope.newTask = ""; $scope.createTask
= function() { if ($scope.newTask.length > 0) { $scope.tasks.push({name: $scope.newTask}); $scope.newTask = ""; } }; }); 4 -
app.controller('demoCtrl', function($scope) { $scope.tasks = []; $scope.newTask = ""; $scope.createTask
= function() { if ($scope.newTask.length > 0) { $scope.tasks.push({name: $scope.newTask}); $scope.newTask = ""; } }; }); 4 -
app.controller('demoCtrl', function($scope) { $scope.tasks = []; $scope.newTask = ""; $scope.createTask
= function() { if ($scope.newTask.length > 0) { $scope.tasks.push({name: $scope.newTask}); $scope.newTask = ""; } }; }); 4 -
<body ng-controller="demoCtrl"> <article> <ul> <li ng-repeat="task in tasks">{{task.text}}</li> <li> <form
ng-submit="createTask();"> <input type="text" ng-model="newTask" /> </form> </li> </ul> </article> </body> -
<body ng-controller="demoCtrl"> <header> <input type="search" ng-model=“search" placeholder="filter" /> </header> <article>
<ul> <li ng-repeat="task in tasks | filter:search”>{{task.text}}</ <li> <form ng-submit="createTask();"> <input type="text" ng-model="newTask" /> </form> </li> </ul> </article> </body> 5 -
<body ng-controller="demoCtrl"> <header> <input type="search" ng-model=“search" placeholder="filter" /> </header> <article>
<ul> <li ng-repeat="task in tasks | filter:search”>{{task.text}}</ <li> <form ng-submit="createTask();"> <input type="text" ng-model="newTask" /> </form> </li> </ul> </article> </body> 5 -
<body ng-controller="demoCtrl"> <header> <input type="search" ng-model=“search" placeholder="filter" /> </header> <article>
<ul> <li ng-repeat="task in tasks | filter:search”>{{task.text}}</ <li> <form ng-submit="createTask();"> <input type="text" ng-model="newTask" /> </form> </li> </ul> </article> </body> 5 -
<body ng-controller="demoCtrl"> <header> <input type="search" ng-model=“search" placeholder="filter" /> </header> <article>
<ul> <li ng-repeat="task in tasks | filter:search”>{{task.text}}</ <li> <form ng-submit="createTask();"> <input type="text" ng-model="newTask" /> </form> </li> </ul> </article> </body> 5 -
<body ng-controller="demoCtrl"> <header> <input type="search" ng-model=“search" placeholder="filter" /> </header> <article>
<ul> <li ng-repeat="task in tasks | filter:search”>{{task.text}}</ <li> <form ng-submit="createTask();"> <input type="text" ng-model="newTask" /> </form> </li> </ul> </article> </body> 5 -
<article> <h1>{{name}}</h1> <time>{{createdAt | date:'dd.MM.yyyy'}}</time> <strong>Price: {{price | currency:'$' }}</strong>
<strong>Weight: {{price | number: 2 }}kg</strong> <p>{{description}}</p> </article> -
<article> <h1>{{name}}</h1> <time>{{createdAt | date:'dd.MM.yyyy'}}</time> <strong>Price: {{price | currency:'$' }}</strong>
<strong>Weight: {{price | number: 2 }}kg</strong> <p>{{description}}</p> </article> -
<article> <h1>{{name}}</h1> <time>{{createdAt | date:'dd.MM.yyyy'}}</time> <strong>Price: {{price | currency:'$' }}</strong>
<strong>Weight: {{price | number: 2 }}kg</strong> <p>{{description}}</p> </article> -
<article> <h1>{{name}}</h1> <time>{{createdAt | date:'dd.MM.yyyy'}}</time> <strong>Price: {{price | currency:'$' }}</strong>
<strong>Weight: {{price | number: 2 }}kg</strong> <p>{{description}}</p> </article> -
<article> <h1>{{name}}</h1> <time>{{createdAt | date:'dd.MM.yyyy'}}</time> <strong>Price: {{price | currency:'$' }}</strong>
<strong>Weight: {{price | number: 2 }}kg</strong> <p>{{description}}</p> </article> -
<article> <h1>{{name}}</h1> <time>{{createdAt | date:'dd.MM.yyyy'}}</time> <strong>Price: {{price | currency:'$' }}</strong>
<strong>Weight: {{price | number: 2 }}kg</strong> <p>{{description}}</p> </article> -
<article> <h1>{{name}}</h1> <time>{{createdAt | date:'dd.MM.yyyy'}}</time> <strong>Price: {{price | currency:'$' }}</strong>
<strong>Weight: {{price | number: 2 }}kg</strong> <p>{{description}}</p> </article> -
<article> <h1>{{name}}</h1> <time>{{createdAt | date:'dd.MM.yyyy'}}</time> <strong>Price: {{price | currency:'$' }}</strong>
<strong>Weight: {{price | number: 2 }}kg</strong> <p>{{description}}</p> </article> -
<article> <h1>{{name}}</h1> <time>{{createdAt | date:'dd.MM.yyyy'}}</time> <strong>Price: {{price | currency:'$' }}</strong>
<strong>Weight: {{price | number: 2 }}kg</strong> <p>{{description}}</p> </article> -
<article> <h1>{{name}}</h1> <time>{{createdAt | date:'dd.MM.yyyy'}}</time> <strong>Price: {{price | currency:'$' }}</strong>
<strong>Weight: {{price | number: 2 }}kg</strong> <p>{{description}}</p> </article> -
<article> <h1>{{name}}</h1> <time>{{createdAt | date:'dd.MM.yyyy'}}</time> <strong>Price: {{price | currency:'$' }}</strong>
<strong>Weight: {{price | number: 2 }}kg</strong> <p ng-bind-html="description"></p> </article> -
<article> <h1>{{name}}</h1> <time>{{createdAt | date:'dd.MM.yyyy'}}</time> <strong>Price: {{price | currency:'$' }}</strong>
<strong>Weight: {{price | number: 2 }}kg</strong> <p ng-bind-html="description"></p> </article> -
<article> <h1>{{name}}</h1> <time>{{createdAt | date:'dd.MM.yyyy'}}</time> <strong>Price: {{price | currency:'$' }}</strong>
<strong>Weight: {{price | number: 2 }}kg</strong> <p ng-bind-html="description"></p> </article> -
<article> <h1>{{name}}</h1> <time>{{createdAt | date:'dd.MM.yyyy'}}</time> <strong>Price: {{price | currency:'$' }}</strong>
<strong>Weight: {{price | number: 2 }}kg</strong> <p ng-bind-html=“description | simpleFormat"></p> </article> -
<article> <h1>{{name}}</h1> <time>{{createdAt | date:'dd.MM.yyyy'}}</time> <strong>Price: {{price | currency:'$' }}</strong>
<strong>Weight: {{price | number: 2 }}kg</strong> <p ng-bind-html=“description | simpleFormat"></p> </article> -
<article> <h1>{{name}}</h1> <time>{{createdAt | date:'dd.MM.yyyy'}}</time> <strong>Price: {{price | currency:'$' }}</strong>
<strong>Weight: {{price | number: 2 }}kg</strong> <p ng-bind-html=“description | simpleFormat"></p> </article> -
<article> <h1>{{name}}</h1> <time>{{createdAt | date:'dd.MM.yyyy'}}</time> <strong>Price: {{price | currency:'$' }}</strong>
<strong>Weight: {{price | number: 2 }}kg</strong> <p ng-bind-html=“description | simpleFormat"></p> </article> -
• Application lifecycle • Conventions • Plugin/module system • Template
engine • Subviews handling • Routing • Testability Angular -
• Application lifecycle • Conventions • Plugin/module system • Template
engine • Subviews handling • Routing! • Testability Angular -
app.config(function($routeProvider) { $routeProvider.when('/people/:id', { templateUrl: 'people/show.html', controller: 'peopleCtrl', resolve: {
person: function($routeParams, People) { return People.get(id: $routeParams.id).$promise; } } }); }); -
app.config(function($routeProvider) { $routeProvider.when('/people/:id', { templateUrl: 'people/show.html', controller: 'peopleCtrl', resolve: {
person: function($routeParams, People) { return People.get(id: $routeParams.id).$promise; } } }); }); -
app.config(function($routeProvider) { $routeProvider.when('/people/:id', { templateUrl: 'people/show.html', controller: 'peopleCtrl', resolve: {
person: function($routeParams, People) { return People.get(id: $routeParams.id).$promise; } } }); }); -
app.config(function($routeProvider) { $routeProvider.when('/people/:id', { templateUrl: 'people/show.html', controller: 'peopleCtrl', resolve: {
person: function($routeParams, People) { return People.get(id: $routeParams.id).$promise; } } }); }); -
app.config(function($routeProvider) { $routeProvider.when('/people/:id', { templateUrl: 'people/show.html', controller: 'peopleCtrl', resolve: {
person: function($routeParams, People) { return People.get(id: $routeParams.id).$promise; } } }); }); -
app.config(function($routeProvider) { $routeProvider.when('/people/:id', { templateUrl: 'people/show.html', controller: 'peopleCtrl', resolve: {
person: function($routeParams, People) { return People.get(id: $routeParams.id).$promise; } } }); }); -
app.config(function($routeProvider) { $routeProvider.when('/people/:id', { templateUrl: 'people/show.html', controller: 'peopleCtrl', resolve: {
person: function($routeParams, People) { return People.get(id: $routeParams.id).$promise; } } }); }); -
app.config(function($routeProvider) { $routeProvider.when('/people/:id', { templateUrl: 'people/show.html', controller: 'peopleCtrl', resolve: {
person: function($routeParams, People) { return People.get(id: $routeParams.id).$promise; } } }); }); -
app.config(function($routeProvider) { $routeProvider.when('/people/:id', { templateUrl: 'people/show.html', controller: 'peopleCtrl', resolve: {
person: function($routeParams, People) { return People.get(id: $routeParams.id).$promise; } } }); }); -
app.config(function($routeProvider) { $routeProvider.when('/people/:id', { templateUrl: 'people/show.html', controller: 'peopleCtrl', resolve: {
person: function($routeParams, People) { return People.get(id: $routeParams.id).$promise; } } }); }); -
app.config(function($routeProvider) { $routeProvider.when('/people/:id', { templateUrl: 'people/show.html', controller: 'peopleCtrl', resolve: {
person: function($routeParams, People) { return People.get(id: $routeParams.id).$promise; } } }); }); -
app.config(function($routeProvider) { $routeProvider.when('/people/:id', { templateUrl: 'people/show.html', controller: 'peopleCtrl', resolve: {
person: function($routeParams, People) { return People.get(id: $routeParams.id).$promise; } } }); }); -
app.config(function($routeProvider) { $routeProvider.when('/people/:id', { templateUrl: 'people/show.html', controller: 'peopleCtrl', resolve: {
person: function($routeParams, People) { return People.get(id: $routeParams.id).$promise; } } }); }); -
app.config(function($routeProvider) { $routeProvider.when('/people/:id', { templateUrl: 'people/show.html', controller: 'peopleCtrl', resolve: {
person: function($routeParams, People) { return People.get(id: $routeParams.id).$promise; } } }); }); -
app.config(function($routeProvider) { $routeProvider.when('/people/:id', { templateUrl: 'people/show.html', controller: 'peopleCtrl', resolve: {
person: function($routeParams, People) { return People.get(id: $routeParams.id).$promise; } } }); }); -
• Application lifecycle • Conventions • Plugin/module system • Template
engine • Subviews handling • Routing • Testability Angular -
• Application lifecycle • Conventions • Plugin/module system • Template
engine • Subviews handling • Routing • Testability Angular -
describe('myDirective', function() { var $compile; var $rootScope; ! beforeEach(module('myApp')); !
beforeEach(inject(function(_$compile_, _$rootScope_){ $compile = _$compile_; $rootScope = _$rootScope_; })); ! it('replaces the element with the appropriate content', function() { var element = $compile("<my-directive></my-directive>")($rootScope); ! $rootScope.$digest(); ! expect(element.html()).toContain('PlovdivConf Part 2'); }); }); -
describe('myDirective', function() { var $compile; var $rootScope; ! beforeEach(module('myApp')); !
beforeEach(inject(function(_$compile_, _$rootScope_){ $compile = _$compile_; $rootScope = _$rootScope_; })); ! it('replaces the element with the appropriate content', function() { var element = $compile("<my-directive></my-directive>")($rootScope); ! $rootScope.$digest(); ! expect(element.html()).toContain('PlovdivConf Part 2'); }); }); -
describe('myDirective', function() { var $compile; var $rootScope; ! beforeEach(module('myApp')); !
beforeEach(inject(function(_$compile_, _$rootScope_){ $compile = _$compile_; $rootScope = _$rootScope_; })); ! it('replaces the element with the appropriate content', function() { var element = $compile("<my-directive></my-directive>")($rootScope); ! $rootScope.$digest(); ! expect(element.html()).toContain('PlovdivConf Part 2'); }); }); -
describe('myDirective', function() { var $compile; var $rootScope; ! beforeEach(module('myApp')); !
beforeEach(inject(function(_$compile_, _$rootScope_){ $compile = _$compile_; $rootScope = _$rootScope_; })); ! it('replaces the element with the appropriate content', function() { var element = $compile("<my-directive></my-directive>")($rootScope); ! $rootScope.$digest(); ! expect(element.html()).toContain('PlovdivConf Part 2'); }); }); -
describe('myDirective', function() { var $compile; var $rootScope; ! beforeEach(module('myApp')); !
beforeEach(inject(function(_$compile_, _$rootScope_){ $compile = _$compile_; $rootScope = _$rootScope_; })); ! it('replaces the element with the appropriate content', function() { var element = $compile("<my-directive></my-directive>")($rootScope); ! $rootScope.$digest(); ! expect(element.html()).toContain('PlovdivConf Part 2'); }); }); -
describe('myDirective', function() { var $compile; var $rootScope; ! beforeEach(module('myApp')); !
beforeEach(inject(function(_$compile_, _$rootScope_){ $compile = _$compile_; $rootScope = _$rootScope_; })); ! it('replaces the element with the appropriate content', function() { var element = $compile("<my-directive></my-directive>")($rootScope); ! $rootScope.$digest(); ! expect(element.html()).toContain('PlovdivConf Part 2'); }); }); -
describe('myDirective', function() { var $compile; var $rootScope; ! beforeEach(module('myApp')); !
beforeEach(inject(function(_$compile_, _$rootScope_){ $compile = _$compile_; $rootScope = _$rootScope_; })); ! it('replaces the element with the appropriate content', function() { var element = $compile("<my-directive></my-directive>")($rootScope); ! $rootScope.$digest(); ! expect(element.html()).toContain('PlovdivConf Part 2'); }); }); -
describe('myDirective', function() { var $compile; var $rootScope; ! beforeEach(module('myApp')); !
beforeEach(inject(function(_$compile_, _$rootScope_){ $compile = _$compile_; $rootScope = _$rootScope_; })); ! it('replaces the element with the appropriate content', function() { var element = $compile("<my-directive></my-directive>")($rootScope); ! $rootScope.$digest(); ! expect(element.html()).toContain('PlovdivConf Part 2'); }); }); -
describe('myDirective', function() { var $compile; var $rootScope; ! beforeEach(module('myApp')); !
beforeEach(inject(function(_$compile_, _$rootScope_){ $compile = _$compile_; $rootScope = _$rootScope_; })); ! it('replaces the element with the appropriate content', function() { var element = $compile("<my-directive></my-directive>")($rootScope); ! $rootScope.$digest(); ! expect(element.html()).toContain('PlovdivConf Part 2'); }); }); -
var app = angular.module('myApp', []); ! app.directive('myDirective', function () {
return { restrict: 'E', replace: true, template: 'PlovdivConf Part {{1 + 1}}' }; }); -
var app = angular.module('myApp', []); ! app.directive('myDirective', function () {
return { restrict: 'E', replace: true, template: 'PlovdivConf Part {{1 + 1}}' }; }); -
var app = angular.module('myApp', []); ! app.directive('myDirective', function () {
return { restrict: 'E', replace: true, template: 'PlovdivConf Part {{1 + 1}}' }; }); -
var app = angular.module('myApp', []); ! app.directive('myDirective', function () {
return { restrict: 'E', replace: true, template: 'PlovdivConf Part {{1 + 1}}' }; }); -
var app = angular.module('myApp', []); ! app.directive('myDirective', function () {
return { restrict: 'E', replace: true, template: 'PlovdivConf Part {{1 + 1}}' }; }); -
var app = angular.module('myApp', []); ! app.directive('myDirective', function () {
return { restrict: 'E', replace: true, template: 'PlovdivConf Part {{1 + 1}}' }; }); -
var app = angular.module('myApp', []); ! app.directive('myDirective', function () {
return { restrict: 'E', replace: true, template: 'PlovdivConf Part {{1 + 1}}' }; }); -
var app = angular.module('myApp', []); ! app.directive('myDirective', function () {
return { restrict: 'E', replace: true, template: 'PlovdivConf Part {{1 + 1}}' }; }); -
var app = angular.module('myApp', []); ! app.directive('myDirective', function () {
return { restrict: 'E', replace: true, template: 'PlovdivConf Part {{1 + 1}}' }; }); -
var app = angular.module('myApp', []); ! app.directive('myDirective', function () {
return { restrict: 'E', replace: true, template: 'PlovdivConf Part {{1 + 1}}' }; }); -
var app = angular.module('myApp', []); ! app.directive('myDirective', function () {
return { restrict: 'E', replace: true, template: 'PlovdivConf Part {{1 + 1}}' }; }); -
Angular • Application lifecycle • Conventions • Plugin/module system •
Template engine • Subviews handling • Routing • Testability -
… even more • angular-resource • angular-animation • angular-i18n •
angular-ui-router • angular-hammer • angular-bindonce • … -
Angular problems • Много магия • Доста логика в HTML
• Performance проблеми -
Angular problems • Много магия • Доста логика в HTML
• Performance проблеми • Learning curve -
Angular problems • Много магия • Доста логика в HTML
• Performance проблеми • Learning curve • Добри практики