SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Downloaden Sie, um offline zu lesen
Josh Staples 
@cubicleDowns 
blog.tempt3d.com 
github.com/cubicleDowns/ng-three-viewer
WHO? Software Engineer @ napofearth.com 
“Explore Music Visually” PRIVATE BETA (#ngmeetup)
TODAY 
1. (v1) Angular & Three.js 3D Model Viewer 
2. (v2) “Controller as” & 
prototypal Angular components 
3. Grunt & Closure compilation approaches 
4. (v3*) Scoped scene graph
WHY? 
Great pattern(s) with low barrier of entry 
& high productivity 
All web devs can easily be 3D web devs 
Isolate THREE code from Angular UI/UX code!
THREE WHAT? 
threejs.org three features 
● Renderers 
● Scene Graph 
● Cameras 
● Animation 
● Lights 
● Materials 
● Shaders 
● Objects 
● Geometry 
● Loaders 
● Utilities 
● Export/Import 
● Support 
● Examples 
● WebVR 
● DIYVR 
Started by Mr. Doob on April 23, 2010
ANGULAR WHO?
Demo v1 
http://localhost:8000/v1/dist/
CONTROLLER 
AppController 
CONTROLLER 
FileLoaderController 
UI Elements and Controllers 
DIRECTIVE INCLUDE 
file-loader.html 
DIRECTIVE INCLUDE 
about.html 
DIRECTIVE INCLUDE 
chrome.html 
DIRECTIVE INCLUDE 
toolbar.html
CONTROLLER 
FileLoaderController 
Dependency Injections Across Angular Components 
CONTROLLER 
AppController 
DIRECTIVE 
select 
SERVICE 
StorageService 
SERVICE 
MessageBus 
FACTORY 
Viewer
Viewer.factory('ViewerFactory', … ) { 
init() 
home = new Viewer.Scene() 
animate () 
render () 
makeSelection () 
loadOBJMTL () 
loadGLTF () 
loadOBJ () 
loadJSON () 
scale () 
rotate () 
/** Translate the model along an axis 
* @param {number} x 
* @param {number} y 
* @param {number} z */ 
translate (x,y,z) 
home.wrangler.currentModel.position.set(x, y, z); 
CONTROLLER 
AppController 
● init () 
● rotate () 
● scale () 
● translate () 
SERVICE 
MessageBus 
DIRECTIVE 
select 
● makeSelection () 
CONTROLLER 
FileLoaderController 
● loadOBJMTL () 
● loadGLTF () 
● loadOBJ () 
● loadJSON () 
Viewer Factory Interface
Viewer Factory Architecture 
Viewer Factory Singleton 
function init(params) { 
home = new Viewer.Scene(params); 
animate(); 
} 
Viewer.Scene() 
this.scene 
THREE.Scene() 
this.renderer 
THREE.WebGLRenderer() 
this.wrangler 
Viewer.Wrangler() 
function animate () { 
requestAnimationFrame(animate); 
render(); 
} 
this.setup 
Viewer.Setup() 
this.cameras 
Viewer.Cameras() 
this.controls 
THREE.OrbitControls() 
this.raycaster 
THREE.Raycaster()
USE CASE - User Click, Intersect 3D Model, Return Model Information 
Angular Directive, <canvas select> 
elem.on(tap, function(e) 
x = e.gesture.center.x; 
y = e.gesture.center.y; 
// creating NDC coordinates for ray intersection. 
mouseDown.x = (x / width) * 2 - 1; 
mouseDown.y = -(y / height) * 2 + 1; 
ViewerFactory.makeSelection(mouseDown); 
Viewer Factory, makeSelection 
makeSelection(mouse): 
Angular Controller/Factory 
$scope.$on(‘objectSelected’, function () { 
// Do Something. 
}); 
var vector = new THREE.Vector3( mouse.x, mouse.y, 1).unproject(home.cameras.liveCam); 
home.raycaster.set(home.cameras.liveCam.position, vector.sub(home.cameras.liveCam.position).normalize()); 
var intersected = home.raycaster.intersectObjects(home.wrangler.currentModel, true); 
MessageBus.trigger('objectSelected', intersected[0])
MOST PROFITABLE MOVIE?
MOST PROFITABLE MOVIE? 
THE SEQUEL!
STARRING 
“Controller as” 
& 
as ctrl 
Annotations 
as SNAFU
Sequel (v2) 
http://localhost:8000/v2/dist/
Controller as 
<div id="file-loader" ng-controller="FileLoaderController as loader" ng-show=”loader.visible”> 
<input type="text" ng-model="loader.data.obj" placeholder="obj file url"> 
<input type="text" ng-model="loader.data.name" placeholder="unique name"> 
<button ng-click="otherLoader.loadOBJMTL()">Load OBJ/MTL</button> 
<button ng-click="loader.loadSampleOBJMTL()">SAMPLE OBJ-MTL</button> 
Controller 
level scope 
:) 
<div id="file-loader" ng-controller="FileLoaderController" ng-show=”visible”> 
- - - 
<input type="text" ng-model="data.obj" placeholder="obj file url"> 
<input type="text" ng-model="data.mtl" placeholder="mtl file url"> 
<button ng-click="loadOBJMTL()">Load OBJ/MTL</button> 
<button ng-click="loadSampleOBJMTL()">SAMPLE OBJ-MTL</button> 
nearest scope 
:(
Service, !Factory 
Viewer.ViewerService 
.prototype 
init 
listeners 
animate 
render 
makeSelection 
loadOBJMTL 
loadOBJ 
loadGLTF 
loadJSON 
rotate 
translate 
scale 
● No More Factories 
○ closure pattern 
● Instead, prototypal Service 
○ ‘new’ and this 
○ .bind() for callbacks 
● Saves Memory, Time, Searches (sorry) 
● Single Pattern For Everything! 
● IMHO, the best way to code JS
/** @ngInject */ 
Viewer.ViewerService = function($timeout, MessageBus){ 
this.timeout = $timeout; 
this.MessageBus = MessageBus; 
}; 
Viewer.ViewerService.prototype.init = function (params){ 
this.home = new Viewer.Scene(params); 
this.MessageBus.trigger(‘app-ready’); 
animate(); 
}; 
Viewer.factory('ViewerFactory', ['MessageBus', function (MessageBus) 
function init () {} 
function makeSelection() {} 
return { 
init: init, 
makeSelection: makeSelection 
} 
closure style, 
ng-annotate 
: 
prototypal 
:) 
Prototypal Angular
CAonnntorotallteior nass 
/** Service which initiates the THREE.js scene and 
* provides methods to interact with that scene 
* 
* @param {angular.$timeout} $timeout 
* @param {!Viewer.MessageBus} MessageBus 
* @constructor 
* @ngInject 
*/ 
Viewer.ViewerService = function($timeout, MessageBus){ 
this.timeout = $timeout; 
this.MessageBus = MessageBus; 
}; 
/** 
* Translate the model along an axis 
* @param {number} x 
* @param {number} y 
* @param {number} z 
*/ 
Viewer.ViewerService.prototype.translate = function(x, y, z){ 
this.home.wrangler.currentModel.position.set(x, y, z) 
}; 
/** 
* @param {number} s 
*/ 
Viewer.ViewerService.prototype.scale = function(s) { 
this.home.wrangler.currentModel.scale.set(s, s, s); 
}; 
The Closure Compiler can use data type 
information about JavaScript variables to provide 
enhanced optimization and warnings.
APP INIT (app.js) 
angular.module('ThreeViewer', ['ngHammer', 'ngRoute', 'LocalStorageModule']) 
.config(['localStorageServiceProvider',function(localStorageServiceProvider){ 
…. 
.config(['$locationProvider', function($locationProvider) { 
…. 
$locationProvider.html5Mode(true); 
.config(['$routeProvider', function($routeProvider){ 
angular.module('ThreeViewer', ['ngRoute', 'LocalStorageModule']) 
.config(ThreeViewer.ConfigLocation) 
…. 
.directive('select', ['ViewerService', ThreeViewer.SelectDirective.factory]) 
…. 
.filter('forceInt', ThreeViewer.ForceInt.factory) 
…. 
.service('ViewerService', [MessageBus', ThreeViewer.ViewerService]) 
…. 
.controller('AppController', ['$scope', 'ViewerService', ThreeViewer.AppController]); 
v2 
:) 
v1 
:
uglify: { 
ng3: { 
options: { 
compress: { 
drop_console: true 
}, 
sourceMap: true, 
}, 
files: { 
'dist/app.min.js': ['<%= concat.ng3.dest %>'] 
} 
} 
}, 
command: 'java -jar closure/compiler.jar ' + 
'--compilation_level SIMPLE_OPTIMIZATIONS' + 
'--language_in ECMASCRIPT5_STRICT ' + 
'--angular_pass ' + 
'--externs closure/externs/angular-1.3.js ' + 
'--externs closure/externs/three.js ' + 
'--generate_exports ' + 
'--manage_closure_dependencies ' + 
'--js closure/library/base.js ' + 
'--js <%= app %> ' + 
'--js <%= ng %> ' + 
'--js <%= three %> ' + 
'--js_output_file dist/app.min.js' 
Minify or Closure Compilation? 
Closure Compiler 
● type checking 
● ngInject 
● goog.provide / require 
Grunt ng-annotate 
● uglify 
● ng-annotate
NOGN Eto A TPHPR, ETEWO PATTERNS 
V1 
● Most Common Angular Pattern 
● Grunt uglify / minify 
● Factories 
● Services 
● Filters 
● Directives 
● Init controllers from DOM 
V2 
● Prototypal Pattern for Everything! 
● Bridge to Angular 2.0 
● Controller as (local scope) 
● Closure Compilation 
○ type checking 
○ -- angular_pass 
○ dependency chains 
○ minification 
● App.js Initialization 
● No closure pattern (factories)
JNOGIN t oU TSH! REE Mobile Developer - Backend Guru 
napofearth.com/jobs UI/UX Designer - QA #ngmeetup

Weitere ähnliche Inhalte

Was ist angesagt?

Workshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte IWorkshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte IVisual Engineering
 
AngularJS Internal
AngularJS InternalAngularJS Internal
AngularJS InternalEyal Vardi
 
준비하세요 Angular js 2.0
준비하세요 Angular js 2.0준비하세요 Angular js 2.0
준비하세요 Angular js 2.0Jeado Ko
 
AngularJS Architecture
AngularJS ArchitectureAngularJS Architecture
AngularJS ArchitectureEyal Vardi
 
Practical AngularJS
Practical AngularJSPractical AngularJS
Practical AngularJSWei Ru
 
CocoaHeads Toulouse - Guillaume Cerquant - UIView
CocoaHeads Toulouse - Guillaume Cerquant - UIViewCocoaHeads Toulouse - Guillaume Cerquant - UIView
CocoaHeads Toulouse - Guillaume Cerquant - UIViewCocoaHeads France
 
AngularJS for designers and developers
AngularJS for designers and developersAngularJS for designers and developers
AngularJS for designers and developersKai Koenig
 
AngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile ServicesAngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile ServicesRainer Stropek
 
AngularJS $Provide Service
AngularJS $Provide ServiceAngularJS $Provide Service
AngularJS $Provide ServiceEyal Vardi
 
AngularJS Animations
AngularJS AnimationsAngularJS Animations
AngularJS AnimationsEyal Vardi
 
Angular js routing options
Angular js routing optionsAngular js routing options
Angular js routing optionsNir Kaufman
 
Workshop 9: BackboneJS y patrones MVC
Workshop 9: BackboneJS y patrones MVCWorkshop 9: BackboneJS y patrones MVC
Workshop 9: BackboneJS y patrones MVCVisual Engineering
 
MVC-RS par Grégoire Lhotelier
MVC-RS par Grégoire LhotelierMVC-RS par Grégoire Lhotelier
MVC-RS par Grégoire LhotelierCocoaHeads France
 

Was ist angesagt? (20)

Workshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte IWorkshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte I
 
AngularJS Basics with Example
AngularJS Basics with ExampleAngularJS Basics with Example
AngularJS Basics with Example
 
AngularJS Internal
AngularJS InternalAngularJS Internal
AngularJS Internal
 
준비하세요 Angular js 2.0
준비하세요 Angular js 2.0준비하세요 Angular js 2.0
준비하세요 Angular js 2.0
 
AngularJS Architecture
AngularJS ArchitectureAngularJS Architecture
AngularJS Architecture
 
Practical AngularJS
Practical AngularJSPractical AngularJS
Practical AngularJS
 
CocoaHeads Toulouse - Guillaume Cerquant - UIView
CocoaHeads Toulouse - Guillaume Cerquant - UIViewCocoaHeads Toulouse - Guillaume Cerquant - UIView
CocoaHeads Toulouse - Guillaume Cerquant - UIView
 
What's new in iOS9
What's new in iOS9What's new in iOS9
What's new in iOS9
 
Angular js
Angular jsAngular js
Angular js
 
Angularjs Performance
Angularjs PerformanceAngularjs Performance
Angularjs Performance
 
AngularJS for designers and developers
AngularJS for designers and developersAngularJS for designers and developers
AngularJS for designers and developers
 
AngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile ServicesAngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile Services
 
AngularJS Basic Training
AngularJS Basic TrainingAngularJS Basic Training
AngularJS Basic Training
 
AngularJS $Provide Service
AngularJS $Provide ServiceAngularJS $Provide Service
AngularJS $Provide Service
 
AngularJS Animations
AngularJS AnimationsAngularJS Animations
AngularJS Animations
 
The AngularJS way
The AngularJS wayThe AngularJS way
The AngularJS way
 
Angular js routing options
Angular js routing optionsAngular js routing options
Angular js routing options
 
Workshop 9: BackboneJS y patrones MVC
Workshop 9: BackboneJS y patrones MVCWorkshop 9: BackboneJS y patrones MVC
Workshop 9: BackboneJS y patrones MVC
 
MVC-RS par Grégoire Lhotelier
MVC-RS par Grégoire LhotelierMVC-RS par Grégoire Lhotelier
MVC-RS par Grégoire Lhotelier
 
Intro to AngularJs
Intro to AngularJsIntro to AngularJs
Intro to AngularJs
 

Andere mochten auch

Angular 2のRenderer
Angular 2のRendererAngular 2のRenderer
Angular 2のRendererYosuke Onoue
 
A-Frame: VR for Web Developers
A-Frame: VR for Web DevelopersA-Frame: VR for Web Developers
A-Frame: VR for Web DevelopersKevin Ngo
 
WebGL and three.js - Web 3D Graphics
WebGL and three.js - Web 3D Graphics WebGL and three.js - Web 3D Graphics
WebGL and three.js - Web 3D Graphics PSTechSerbia
 
Build the Virtual Reality Web with A-Frame
Build the Virtual Reality Web with A-FrameBuild the Virtual Reality Web with A-Frame
Build the Virtual Reality Web with A-FrameMozilla VR
 
Introduction to WebGL and WebVR
Introduction to WebGL and WebVRIntroduction to WebGL and WebVR
Introduction to WebGL and WebVRDaosheng Mu
 
The next frontier: WebGL and WebVR
The next frontier: WebGL and WebVRThe next frontier: WebGL and WebVR
The next frontier: WebGL and WebVRCodemotion
 
WebVR - MobileTechCon Berlin 2016
WebVR - MobileTechCon Berlin 2016WebVR - MobileTechCon Berlin 2016
WebVR - MobileTechCon Berlin 2016Carsten Sandtner
 
An Introduction to WebVR – or How to make your user sick in 60 seconds
An Introduction to WebVR – or How to make your user sick in 60 secondsAn Introduction to WebVR – or How to make your user sick in 60 seconds
An Introduction to WebVR – or How to make your user sick in 60 secondsGeilDanke
 
Bringing Virtual Reality to the Web: VR, WebGL and CSS – Together At Last!
Bringing Virtual Reality to the Web: VR, WebGL and CSS – Together At Last!Bringing Virtual Reality to the Web: VR, WebGL and CSS – Together At Last!
Bringing Virtual Reality to the Web: VR, WebGL and CSS – Together At Last!FITC
 
Virtually Anyone
Virtually AnyoneVirtually Anyone
Virtually AnyoneTony Parisi
 
Foundations of the Immersive Web
Foundations of the Immersive WebFoundations of the Immersive Web
Foundations of the Immersive WebTony Parisi
 
WebGL, HTML5 and How the Mobile Web Was Won
WebGL, HTML5 and How the Mobile Web Was WonWebGL, HTML5 and How the Mobile Web Was Won
WebGL, HTML5 and How the Mobile Web Was WonTony Parisi
 
Hacking Reality: Browser-Based VR with HTML5
Hacking Reality: Browser-Based VR with HTML5Hacking Reality: Browser-Based VR with HTML5
Hacking Reality: Browser-Based VR with HTML5Tony Parisi
 
Powering the VR/AR Ecosystem 2017-01-17
Powering the VR/AR Ecosystem 2017-01-17Powering the VR/AR Ecosystem 2017-01-17
Powering the VR/AR Ecosystem 2017-01-17Tony Parisi
 
WebGL: The Next Generation
WebGL:  The Next GenerationWebGL:  The Next Generation
WebGL: The Next GenerationTony Parisi
 
An Introduction to Web VR January 2015
An Introduction to Web VR January 2015An Introduction to Web VR January 2015
An Introduction to Web VR January 2015Tony Parisi
 
The Immersive Web
The Immersive WebThe Immersive Web
The Immersive WebTony Parisi
 

Andere mochten auch (20)

Angular 2のRenderer
Angular 2のRendererAngular 2のRenderer
Angular 2のRenderer
 
About WinJS
About WinJSAbout WinJS
About WinJS
 
Intro to Three.js
Intro to Three.jsIntro to Three.js
Intro to Three.js
 
A-Frame: VR for Web Developers
A-Frame: VR for Web DevelopersA-Frame: VR for Web Developers
A-Frame: VR for Web Developers
 
WebGL and three.js - Web 3D Graphics
WebGL and three.js - Web 3D Graphics WebGL and three.js - Web 3D Graphics
WebGL and three.js - Web 3D Graphics
 
Build the Virtual Reality Web with A-Frame
Build the Virtual Reality Web with A-FrameBuild the Virtual Reality Web with A-Frame
Build the Virtual Reality Web with A-Frame
 
Introduction to WebGL and WebVR
Introduction to WebGL and WebVRIntroduction to WebGL and WebVR
Introduction to WebGL and WebVR
 
The next frontier: WebGL and WebVR
The next frontier: WebGL and WebVRThe next frontier: WebGL and WebVR
The next frontier: WebGL and WebVR
 
WebVR
WebVRWebVR
WebVR
 
WebVR - MobileTechCon Berlin 2016
WebVR - MobileTechCon Berlin 2016WebVR - MobileTechCon Berlin 2016
WebVR - MobileTechCon Berlin 2016
 
An Introduction to WebVR – or How to make your user sick in 60 seconds
An Introduction to WebVR – or How to make your user sick in 60 secondsAn Introduction to WebVR – or How to make your user sick in 60 seconds
An Introduction to WebVR – or How to make your user sick in 60 seconds
 
Bringing Virtual Reality to the Web: VR, WebGL and CSS – Together At Last!
Bringing Virtual Reality to the Web: VR, WebGL and CSS – Together At Last!Bringing Virtual Reality to the Web: VR, WebGL and CSS – Together At Last!
Bringing Virtual Reality to the Web: VR, WebGL and CSS – Together At Last!
 
Virtually Anyone
Virtually AnyoneVirtually Anyone
Virtually Anyone
 
Foundations of the Immersive Web
Foundations of the Immersive WebFoundations of the Immersive Web
Foundations of the Immersive Web
 
WebGL, HTML5 and How the Mobile Web Was Won
WebGL, HTML5 and How the Mobile Web Was WonWebGL, HTML5 and How the Mobile Web Was Won
WebGL, HTML5 and How the Mobile Web Was Won
 
Hacking Reality: Browser-Based VR with HTML5
Hacking Reality: Browser-Based VR with HTML5Hacking Reality: Browser-Based VR with HTML5
Hacking Reality: Browser-Based VR with HTML5
 
Powering the VR/AR Ecosystem 2017-01-17
Powering the VR/AR Ecosystem 2017-01-17Powering the VR/AR Ecosystem 2017-01-17
Powering the VR/AR Ecosystem 2017-01-17
 
WebGL: The Next Generation
WebGL:  The Next GenerationWebGL:  The Next Generation
WebGL: The Next Generation
 
An Introduction to Web VR January 2015
An Introduction to Web VR January 2015An Introduction to Web VR January 2015
An Introduction to Web VR January 2015
 
The Immersive Web
The Immersive WebThe Immersive Web
The Immersive Web
 

Ähnlich wie Integrating Angular js & three.js

Synchronizing without internet - Multipeer Connectivity (iOS)
Synchronizing without internet - Multipeer Connectivity (iOS)Synchronizing without internet - Multipeer Connectivity (iOS)
Synchronizing without internet - Multipeer Connectivity (iOS)Jorge Maroto
 
Webgl para JavaScripters
Webgl para JavaScriptersWebgl para JavaScripters
Webgl para JavaScriptersgerbille
 
303 TANSTAAFL: Using Open Source iPhone UI Code
303 TANSTAAFL: Using Open Source iPhone UI Code303 TANSTAAFL: Using Open Source iPhone UI Code
303 TANSTAAFL: Using Open Source iPhone UI Codejonmarimba
 
Leaving Flatland: getting started with WebGL
Leaving Flatland: getting started with WebGLLeaving Flatland: getting started with WebGL
Leaving Flatland: getting started with WebGLgerbille
 
Dependency Injection @ AngularJS
Dependency Injection @ AngularJSDependency Injection @ AngularJS
Dependency Injection @ AngularJSRan Mizrahi
 
Workshop 13: AngularJS Parte II
Workshop 13: AngularJS Parte IIWorkshop 13: AngularJS Parte II
Workshop 13: AngularJS Parte IIVisual Engineering
 
Курсы по мобильной разработке под iOS. 4 лекция. Возможности телефона
Курсы по мобильной разработке под iOS. 4 лекция. Возможности телефонаКурсы по мобильной разработке под iOS. 4 лекция. Возможности телефона
Курсы по мобильной разработке под iOS. 4 лекция. Возможности телефонаГлеб Тарасов
 
Design Summit - UI Roadmap - Dan Clarizio, Martin Povolny
Design Summit - UI Roadmap - Dan Clarizio, Martin PovolnyDesign Summit - UI Roadmap - Dan Clarizio, Martin Povolny
Design Summit - UI Roadmap - Dan Clarizio, Martin PovolnyManageIQ
 
Android Best Practices
Android Best PracticesAndroid Best Practices
Android Best PracticesYekmer Simsek
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Eliran Eliassy
 
Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...
Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...
Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...OdessaJS Conf
 
Re-Design with Elixir/OTP
Re-Design with Elixir/OTPRe-Design with Elixir/OTP
Re-Design with Elixir/OTPMustafa TURAN
 
Modules and injector
Modules and injectorModules and injector
Modules and injectorEyal Vardi
 
3D Web Programming [Thanh Loc Vo , CTO Epsilon Mobile ]
3D Web Programming [Thanh Loc Vo , CTO Epsilon Mobile ]3D Web Programming [Thanh Loc Vo , CTO Epsilon Mobile ]
3D Web Programming [Thanh Loc Vo , CTO Epsilon Mobile ]JavaScript Meetup HCMC
 
Migrating to Angular 2
Migrating to Angular 2Migrating to Angular 2
Migrating to Angular 2FITC
 
DrupalCon Dublin 2016 - Automated browser testing with Nightwatch.js
DrupalCon Dublin 2016 - Automated browser testing with Nightwatch.jsDrupalCon Dublin 2016 - Automated browser testing with Nightwatch.js
DrupalCon Dublin 2016 - Automated browser testing with Nightwatch.jsVladimir Roudakov
 

Ähnlich wie Integrating Angular js & three.js (20)

Synchronizing without internet - Multipeer Connectivity (iOS)
Synchronizing without internet - Multipeer Connectivity (iOS)Synchronizing without internet - Multipeer Connectivity (iOS)
Synchronizing without internet - Multipeer Connectivity (iOS)
 
Webgl para JavaScripters
Webgl para JavaScriptersWebgl para JavaScripters
Webgl para JavaScripters
 
303 TANSTAAFL: Using Open Source iPhone UI Code
303 TANSTAAFL: Using Open Source iPhone UI Code303 TANSTAAFL: Using Open Source iPhone UI Code
303 TANSTAAFL: Using Open Source iPhone UI Code
 
Leaving Flatland: getting started with WebGL
Leaving Flatland: getting started with WebGLLeaving Flatland: getting started with WebGL
Leaving Flatland: getting started with WebGL
 
Introduction to angular js
Introduction to angular jsIntroduction to angular js
Introduction to angular js
 
Dependency Injection @ AngularJS
Dependency Injection @ AngularJSDependency Injection @ AngularJS
Dependency Injection @ AngularJS
 
Workshop 13: AngularJS Parte II
Workshop 13: AngularJS Parte IIWorkshop 13: AngularJS Parte II
Workshop 13: AngularJS Parte II
 
Explaination of angular
Explaination of angularExplaination of angular
Explaination of angular
 
Курсы по мобильной разработке под iOS. 4 лекция. Возможности телефона
Курсы по мобильной разработке под iOS. 4 лекция. Возможности телефонаКурсы по мобильной разработке под iOS. 4 лекция. Возможности телефона
Курсы по мобильной разработке под iOS. 4 лекция. Возможности телефона
 
Design Summit - UI Roadmap - Dan Clarizio, Martin Povolny
Design Summit - UI Roadmap - Dan Clarizio, Martin PovolnyDesign Summit - UI Roadmap - Dan Clarizio, Martin Povolny
Design Summit - UI Roadmap - Dan Clarizio, Martin Povolny
 
Mini-Training: AngularJS
Mini-Training: AngularJSMini-Training: AngularJS
Mini-Training: AngularJS
 
Android Best Practices
Android Best PracticesAndroid Best Practices
Android Best Practices
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics
 
Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...
Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...
Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...
 
Re-Design with Elixir/OTP
Re-Design with Elixir/OTPRe-Design with Elixir/OTP
Re-Design with Elixir/OTP
 
Modules and injector
Modules and injectorModules and injector
Modules and injector
 
AngularJs
AngularJsAngularJs
AngularJs
 
3D Web Programming [Thanh Loc Vo , CTO Epsilon Mobile ]
3D Web Programming [Thanh Loc Vo , CTO Epsilon Mobile ]3D Web Programming [Thanh Loc Vo , CTO Epsilon Mobile ]
3D Web Programming [Thanh Loc Vo , CTO Epsilon Mobile ]
 
Migrating to Angular 2
Migrating to Angular 2Migrating to Angular 2
Migrating to Angular 2
 
DrupalCon Dublin 2016 - Automated browser testing with Nightwatch.js
DrupalCon Dublin 2016 - Automated browser testing with Nightwatch.jsDrupalCon Dublin 2016 - Automated browser testing with Nightwatch.js
DrupalCon Dublin 2016 - Automated browser testing with Nightwatch.js
 

Kürzlich hochgeladen

Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
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
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
+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
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
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
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
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
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 

Kürzlich hochgeladen (20)

Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
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-...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
+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...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
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
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
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
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 

Integrating Angular js & three.js

  • 1.
  • 2. Josh Staples @cubicleDowns blog.tempt3d.com github.com/cubicleDowns/ng-three-viewer
  • 3. WHO? Software Engineer @ napofearth.com “Explore Music Visually” PRIVATE BETA (#ngmeetup)
  • 4. TODAY 1. (v1) Angular & Three.js 3D Model Viewer 2. (v2) “Controller as” & prototypal Angular components 3. Grunt & Closure compilation approaches 4. (v3*) Scoped scene graph
  • 5. WHY? Great pattern(s) with low barrier of entry & high productivity All web devs can easily be 3D web devs Isolate THREE code from Angular UI/UX code!
  • 6. THREE WHAT? threejs.org three features ● Renderers ● Scene Graph ● Cameras ● Animation ● Lights ● Materials ● Shaders ● Objects ● Geometry ● Loaders ● Utilities ● Export/Import ● Support ● Examples ● WebVR ● DIYVR Started by Mr. Doob on April 23, 2010
  • 9. CONTROLLER AppController CONTROLLER FileLoaderController UI Elements and Controllers DIRECTIVE INCLUDE file-loader.html DIRECTIVE INCLUDE about.html DIRECTIVE INCLUDE chrome.html DIRECTIVE INCLUDE toolbar.html
  • 10. CONTROLLER FileLoaderController Dependency Injections Across Angular Components CONTROLLER AppController DIRECTIVE select SERVICE StorageService SERVICE MessageBus FACTORY Viewer
  • 11. Viewer.factory('ViewerFactory', … ) { init() home = new Viewer.Scene() animate () render () makeSelection () loadOBJMTL () loadGLTF () loadOBJ () loadJSON () scale () rotate () /** Translate the model along an axis * @param {number} x * @param {number} y * @param {number} z */ translate (x,y,z) home.wrangler.currentModel.position.set(x, y, z); CONTROLLER AppController ● init () ● rotate () ● scale () ● translate () SERVICE MessageBus DIRECTIVE select ● makeSelection () CONTROLLER FileLoaderController ● loadOBJMTL () ● loadGLTF () ● loadOBJ () ● loadJSON () Viewer Factory Interface
  • 12. Viewer Factory Architecture Viewer Factory Singleton function init(params) { home = new Viewer.Scene(params); animate(); } Viewer.Scene() this.scene THREE.Scene() this.renderer THREE.WebGLRenderer() this.wrangler Viewer.Wrangler() function animate () { requestAnimationFrame(animate); render(); } this.setup Viewer.Setup() this.cameras Viewer.Cameras() this.controls THREE.OrbitControls() this.raycaster THREE.Raycaster()
  • 13. USE CASE - User Click, Intersect 3D Model, Return Model Information Angular Directive, <canvas select> elem.on(tap, function(e) x = e.gesture.center.x; y = e.gesture.center.y; // creating NDC coordinates for ray intersection. mouseDown.x = (x / width) * 2 - 1; mouseDown.y = -(y / height) * 2 + 1; ViewerFactory.makeSelection(mouseDown); Viewer Factory, makeSelection makeSelection(mouse): Angular Controller/Factory $scope.$on(‘objectSelected’, function () { // Do Something. }); var vector = new THREE.Vector3( mouse.x, mouse.y, 1).unproject(home.cameras.liveCam); home.raycaster.set(home.cameras.liveCam.position, vector.sub(home.cameras.liveCam.position).normalize()); var intersected = home.raycaster.intersectObjects(home.wrangler.currentModel, true); MessageBus.trigger('objectSelected', intersected[0])
  • 15. MOST PROFITABLE MOVIE? THE SEQUEL!
  • 16. STARRING “Controller as” & as ctrl Annotations as SNAFU
  • 18. Controller as <div id="file-loader" ng-controller="FileLoaderController as loader" ng-show=”loader.visible”> <input type="text" ng-model="loader.data.obj" placeholder="obj file url"> <input type="text" ng-model="loader.data.name" placeholder="unique name"> <button ng-click="otherLoader.loadOBJMTL()">Load OBJ/MTL</button> <button ng-click="loader.loadSampleOBJMTL()">SAMPLE OBJ-MTL</button> Controller level scope :) <div id="file-loader" ng-controller="FileLoaderController" ng-show=”visible”> - - - <input type="text" ng-model="data.obj" placeholder="obj file url"> <input type="text" ng-model="data.mtl" placeholder="mtl file url"> <button ng-click="loadOBJMTL()">Load OBJ/MTL</button> <button ng-click="loadSampleOBJMTL()">SAMPLE OBJ-MTL</button> nearest scope :(
  • 19. Service, !Factory Viewer.ViewerService .prototype init listeners animate render makeSelection loadOBJMTL loadOBJ loadGLTF loadJSON rotate translate scale ● No More Factories ○ closure pattern ● Instead, prototypal Service ○ ‘new’ and this ○ .bind() for callbacks ● Saves Memory, Time, Searches (sorry) ● Single Pattern For Everything! ● IMHO, the best way to code JS
  • 20. /** @ngInject */ Viewer.ViewerService = function($timeout, MessageBus){ this.timeout = $timeout; this.MessageBus = MessageBus; }; Viewer.ViewerService.prototype.init = function (params){ this.home = new Viewer.Scene(params); this.MessageBus.trigger(‘app-ready’); animate(); }; Viewer.factory('ViewerFactory', ['MessageBus', function (MessageBus) function init () {} function makeSelection() {} return { init: init, makeSelection: makeSelection } closure style, ng-annotate : prototypal :) Prototypal Angular
  • 21. CAonnntorotallteior nass /** Service which initiates the THREE.js scene and * provides methods to interact with that scene * * @param {angular.$timeout} $timeout * @param {!Viewer.MessageBus} MessageBus * @constructor * @ngInject */ Viewer.ViewerService = function($timeout, MessageBus){ this.timeout = $timeout; this.MessageBus = MessageBus; }; /** * Translate the model along an axis * @param {number} x * @param {number} y * @param {number} z */ Viewer.ViewerService.prototype.translate = function(x, y, z){ this.home.wrangler.currentModel.position.set(x, y, z) }; /** * @param {number} s */ Viewer.ViewerService.prototype.scale = function(s) { this.home.wrangler.currentModel.scale.set(s, s, s); }; The Closure Compiler can use data type information about JavaScript variables to provide enhanced optimization and warnings.
  • 22. APP INIT (app.js) angular.module('ThreeViewer', ['ngHammer', 'ngRoute', 'LocalStorageModule']) .config(['localStorageServiceProvider',function(localStorageServiceProvider){ …. .config(['$locationProvider', function($locationProvider) { …. $locationProvider.html5Mode(true); .config(['$routeProvider', function($routeProvider){ angular.module('ThreeViewer', ['ngRoute', 'LocalStorageModule']) .config(ThreeViewer.ConfigLocation) …. .directive('select', ['ViewerService', ThreeViewer.SelectDirective.factory]) …. .filter('forceInt', ThreeViewer.ForceInt.factory) …. .service('ViewerService', [MessageBus', ThreeViewer.ViewerService]) …. .controller('AppController', ['$scope', 'ViewerService', ThreeViewer.AppController]); v2 :) v1 :
  • 23. uglify: { ng3: { options: { compress: { drop_console: true }, sourceMap: true, }, files: { 'dist/app.min.js': ['<%= concat.ng3.dest %>'] } } }, command: 'java -jar closure/compiler.jar ' + '--compilation_level SIMPLE_OPTIMIZATIONS' + '--language_in ECMASCRIPT5_STRICT ' + '--angular_pass ' + '--externs closure/externs/angular-1.3.js ' + '--externs closure/externs/three.js ' + '--generate_exports ' + '--manage_closure_dependencies ' + '--js closure/library/base.js ' + '--js <%= app %> ' + '--js <%= ng %> ' + '--js <%= three %> ' + '--js_output_file dist/app.min.js' Minify or Closure Compilation? Closure Compiler ● type checking ● ngInject ● goog.provide / require Grunt ng-annotate ● uglify ● ng-annotate
  • 24. NOGN Eto A TPHPR, ETEWO PATTERNS V1 ● Most Common Angular Pattern ● Grunt uglify / minify ● Factories ● Services ● Filters ● Directives ● Init controllers from DOM V2 ● Prototypal Pattern for Everything! ● Bridge to Angular 2.0 ● Controller as (local scope) ● Closure Compilation ○ type checking ○ -- angular_pass ○ dependency chains ○ minification ● App.js Initialization ● No closure pattern (factories)
  • 25. JNOGIN t oU TSH! REE Mobile Developer - Backend Guru napofearth.com/jobs UI/UX Designer - QA #ngmeetup