Presentation is loading. Please wait.

Presentation is loading. Please wait.

 AngularJS & Drupal What works good. AngularJS  Client-side JS library  Follows MVC pattern  Two-way data-binding model view  Dependency Injection.

Similar presentations


Presentation on theme: " AngularJS & Drupal What works good. AngularJS  Client-side JS library  Follows MVC pattern  Two-way data-binding model view  Dependency Injection."— Presentation transcript:

1  AngularJS & Drupal What works good

2 AngularJS  Client-side JS library  Follows MVC pattern  Two-way data-binding model view  Dependency Injection  Decouples theming aspects from Drupal  Allows to write HTML and CSS from scratch

3

4 3-levels deep menu

5

6 AngularJS directives  Marker on the element to attach specified behavior 

7 AngularJS controller  JS code to rule the application  var InstagramModule = angular.module( 'Instagram', [ 'ngTouch' ]); InstagramModule. controller ( 'InstagramController', function ($scope, $http, $interval) { // Get the data. $http.get(Drupal. settings. ok_instagram ).success( function (data) { $scope. items = data; $scope. index = 0; }); });

8 More directives   $scope.itemClass = function (item_index) { return ($scope. index === item_index) ? 'active-true' : 'active-false' ; };

9 Several Applications per page  You can have as many ng-app per page as you want  Just use the “angular.bootstrap()”  // Bootstrap AngularJS application. angular. bootstrap ( document.getElementById( 'ok- instagram' ), [ 'Instagram' ]);

10 Alternative to ESI  Pages are delivered by Varnish or other reverse proxy  Some parts of them should be dynamic  Build these parts using AngularJS

11 Full page applications  Front-end uses only AngularJS  You should keep the exposed back-end APIs fixed  Back-end can evolve and change while the front-end applications consume the same API  BUT: search engines index (prerender.io)

12 Thank you! andrew.berezovsky@gmail.com


Download ppt " AngularJS & Drupal What works good. AngularJS  Client-side JS library  Follows MVC pattern  Two-way data-binding model view  Dependency Injection."

Similar presentations


Ads by Google