not do front-end or design I rewrote and maintain TodoMVC Ember.js ports (Œ(food wine cycling)) GeekMeet #12, Cluj-Napoca, Transilvania 2 / 19 Octomber 20th, 2012
not do front-end or design I rewrote and maintain TodoMVC Ember.js ports (Œ(food wine cycling)) GeekMeet #12, Cluj-Napoca, Transilvania 2 / 19 Octomber 20th, 2012
not do front-end or design I rewrote and maintain TodoMVC Ember.js ports (Œ(food wine cycling)) GeekMeet #12, Cluj-Napoca, Transilvania 2 / 19 Octomber 20th, 2012
not do front-end or design I rewrote and maintain TodoMVC Ember.js ports (Œ(food wine cycling)) GeekMeet #12, Cluj-Napoca, Transilvania 2 / 19 Octomber 20th, 2012
not do front-end or design I rewrote and maintain TodoMVC Ember.js ports (Œ(food wine cycling)) GeekMeet #12, Cluj-Napoca, Transilvania 2 / 19 Octomber 20th, 2012
not do front-end or design I rewrote and maintain TodoMVC Ember.js ports (Œ(food wine cycling)) GeekMeet #12, Cluj-Napoca, Transilvania 2 / 19 Octomber 20th, 2012
for a front-end solution for non-front-end developers it had to be MVC it had to be something which was around for some time already it had to know fancy stuff like: bindings observers routing little or almost no HTML (declarative views) features over modularity (should not be spread over into a bunch of separate projects) GeekMeet #12, Cluj-Napoca, Transilvania 4 / 19 Octomber 20th, 2012
for a front-end solution for non-front-end developers it had to be MVC it had to be something which was around for some time already it had to know fancy stuff like: bindings observers routing little or almost no HTML (declarative views) features over modularity (should not be spread over into a bunch of separate projects) GeekMeet #12, Cluj-Napoca, Transilvania 4 / 19 Octomber 20th, 2012
for a front-end solution for non-front-end developers it had to be MVC it had to be something which was around for some time already it had to know fancy stuff like: bindings observers routing little or almost no HTML (declarative views) features over modularity (should not be spread over into a bunch of separate projects) GeekMeet #12, Cluj-Napoca, Transilvania 4 / 19 Octomber 20th, 2012
for a front-end solution for non-front-end developers it had to be MVC it had to be something which was around for some time already it had to know fancy stuff like: bindings observers routing little or almost no HTML (declarative views) features over modularity (should not be spread over into a bunch of separate projects) GeekMeet #12, Cluj-Napoca, Transilvania 4 / 19 Octomber 20th, 2012
for a front-end solution for non-front-end developers it had to be MVC it had to be something which was around for some time already it had to know fancy stuff like: bindings observers routing little or almost no HTML (declarative views) features over modularity (should not be spread over into a bunch of separate projects) GeekMeet #12, Cluj-Napoca, Transilvania 4 / 19 Octomber 20th, 2012
for a front-end solution for non-front-end developers it had to be MVC it had to be something which was around for some time already it had to know fancy stuff like: bindings observers routing little or almost no HTML (declarative views) features over modularity (should not be spread over into a bunch of separate projects) GeekMeet #12, Cluj-Napoca, Transilvania 4 / 19 Octomber 20th, 2012
for a front-end solution for non-front-end developers it had to be MVC it had to be something which was around for some time already it had to know fancy stuff like: bindings observers routing little or almost no HTML (declarative views) features over modularity (should not be spread over into a bunch of separate projects) GeekMeet #12, Cluj-Napoca, Transilvania 4 / 19 Octomber 20th, 2012
for a front-end solution for non-front-end developers it had to be MVC it had to be something which was around for some time already it had to know fancy stuff like: bindings observers routing little or almost no HTML (declarative views) features over modularity (should not be spread over into a bunch of separate projects) GeekMeet #12, Cluj-Napoca, Transilvania 4 / 19 Octomber 20th, 2012
for a front-end solution for non-front-end developers it had to be MVC it had to be something which was around for some time already it had to know fancy stuff like: bindings observers routing little or almost no HTML (declarative views) features over modularity (should not be spread over into a bunch of separate projects) GeekMeet #12, Cluj-Napoca, Transilvania 4 / 19 Octomber 20th, 2012
developers understand and pick the best of available JavaScript frameworks mostly MV* projects has a strict list of specs it will also offer tests (WIP) has some nice guys as developers/maintainers Addy Osmani Sindre Sorhus collaborates directly with project authors when it comes to reviews/design awesome educational project http://todomvc.com GeekMeet #12, Cluj-Napoca, Transilvania 5 / 19 Octomber 20th, 2012
developers understand and pick the best of available JavaScript frameworks mostly MV* projects has a strict list of specs it will also offer tests (WIP) has some nice guys as developers/maintainers Addy Osmani Sindre Sorhus collaborates directly with project authors when it comes to reviews/design awesome educational project http://todomvc.com GeekMeet #12, Cluj-Napoca, Transilvania 5 / 19 Octomber 20th, 2012
developers understand and pick the best of available JavaScript frameworks mostly MV* projects has a strict list of specs it will also offer tests (WIP) has some nice guys as developers/maintainers Addy Osmani Sindre Sorhus collaborates directly with project authors when it comes to reviews/design awesome educational project http://todomvc.com GeekMeet #12, Cluj-Napoca, Transilvania 5 / 19 Octomber 20th, 2012
developers understand and pick the best of available JavaScript frameworks mostly MV* projects has a strict list of specs it will also offer tests (WIP) has some nice guys as developers/maintainers Addy Osmani Sindre Sorhus collaborates directly with project authors when it comes to reviews/design awesome educational project http://todomvc.com GeekMeet #12, Cluj-Napoca, Transilvania 5 / 19 Octomber 20th, 2012
developers understand and pick the best of available JavaScript frameworks mostly MV* projects has a strict list of specs it will also offer tests (WIP) has some nice guys as developers/maintainers Addy Osmani Sindre Sorhus collaborates directly with project authors when it comes to reviews/design awesome educational project http://todomvc.com GeekMeet #12, Cluj-Napoca, Transilvania 5 / 19 Octomber 20th, 2012
developers understand and pick the best of available JavaScript frameworks mostly MV* projects has a strict list of specs it will also offer tests (WIP) has some nice guys as developers/maintainers Addy Osmani Sindre Sorhus collaborates directly with project authors when it comes to reviews/design awesome educational project http://todomvc.com GeekMeet #12, Cluj-Napoca, Transilvania 5 / 19 Octomber 20th, 2012
developers understand and pick the best of available JavaScript frameworks mostly MV* projects has a strict list of specs it will also offer tests (WIP) has some nice guys as developers/maintainers Addy Osmani Sindre Sorhus collaborates directly with project authors when it comes to reviews/design awesome educational project http://todomvc.com GeekMeet #12, Cluj-Napoca, Transilvania 5 / 19 Octomber 20th, 2012
developers understand and pick the best of available JavaScript frameworks mostly MV* projects has a strict list of specs it will also offer tests (WIP) has some nice guys as developers/maintainers Addy Osmani Sindre Sorhus collaborates directly with project authors when it comes to reviews/design awesome educational project http://todomvc.com GeekMeet #12, Cluj-Napoca, Transilvania 5 / 19 Octomber 20th, 2012
developers understand and pick the best of available JavaScript frameworks mostly MV* projects has a strict list of specs it will also offer tests (WIP) has some nice guys as developers/maintainers Addy Osmani Sindre Sorhus collaborates directly with project authors when it comes to reviews/design awesome educational project http://todomvc.com GeekMeet #12, Cluj-Napoca, Transilvania 5 / 19 Octomber 20th, 2012
above º has conventions (cough-cough rails) it is everything you need in one box cause it’s fun to write Ember.js app, and I’ll try to prove it http://emberjs.com GeekMeet #12, Cluj-Napoca, Transilvania 6 / 19 Octomber 20th, 2012
above º has conventions (cough-cough rails) it is everything you need in one box cause it’s fun to write Ember.js app, and I’ll try to prove it http://emberjs.com GeekMeet #12, Cluj-Napoca, Transilvania 6 / 19 Octomber 20th, 2012
above º has conventions (cough-cough rails) it is everything you need in one box cause it’s fun to write Ember.js app, and I’ll try to prove it http://emberjs.com GeekMeet #12, Cluj-Napoca, Transilvania 6 / 19 Octomber 20th, 2012
above º has conventions (cough-cough rails) it is everything you need in one box cause it’s fun to write Ember.js app, and I’ll try to prove it http://emberjs.com GeekMeet #12, Cluj-Napoca, Transilvania 6 / 19 Octomber 20th, 2012
TodoMVC port while learning Ember.js to make it easier for everyone, I wrote a simple app so you can understand it just by reading my slides your next step will be to check out the code from this repository after what I would like to invite you to take a look at TodoMVC Ember.js port you should try it and maybe send some patches, hints: refactor some tests update the code with upcoming Ember.js v.1.0 API changes rewrite todo.js model GeekMeet #12, Cluj-Napoca, Transilvania 7 / 19 Octomber 20th, 2012
TodoMVC port while learning Ember.js to make it easier for everyone, I wrote a simple app so you can understand it just by reading my slides your next step will be to check out the code from this repository after what I would like to invite you to take a look at TodoMVC Ember.js port you should try it and maybe send some patches, hints: refactor some tests update the code with upcoming Ember.js v.1.0 API changes rewrite todo.js model GeekMeet #12, Cluj-Napoca, Transilvania 7 / 19 Octomber 20th, 2012
TodoMVC port while learning Ember.js to make it easier for everyone, I wrote a simple app so you can understand it just by reading my slides your next step will be to check out the code from this repository after what I would like to invite you to take a look at TodoMVC Ember.js port you should try it and maybe send some patches, hints: refactor some tests update the code with upcoming Ember.js v.1.0 API changes rewrite todo.js model GeekMeet #12, Cluj-Napoca, Transilvania 7 / 19 Octomber 20th, 2012
TodoMVC port while learning Ember.js to make it easier for everyone, I wrote a simple app so you can understand it just by reading my slides your next step will be to check out the code from this repository after what I would like to invite you to take a look at TodoMVC Ember.js port you should try it and maybe send some patches, hints: refactor some tests update the code with upcoming Ember.js v.1.0 API changes rewrite todo.js model GeekMeet #12, Cluj-Napoca, Transilvania 7 / 19 Octomber 20th, 2012
TodoMVC port while learning Ember.js to make it easier for everyone, I wrote a simple app so you can understand it just by reading my slides your next step will be to check out the code from this repository after what I would like to invite you to take a look at TodoMVC Ember.js port you should try it and maybe send some patches, hints: refactor some tests update the code with upcoming Ember.js v.1.0 API changes rewrite todo.js model GeekMeet #12, Cluj-Napoca, Transilvania 7 / 19 Octomber 20th, 2012
TodoMVC port while learning Ember.js to make it easier for everyone, I wrote a simple app so you can understand it just by reading my slides your next step will be to check out the code from this repository after what I would like to invite you to take a look at TodoMVC Ember.js port you should try it and maybe send some patches, hints: refactor some tests update the code with upcoming Ember.js v.1.0 API changes rewrite todo.js model GeekMeet #12, Cluj-Napoca, Transilvania 7 / 19 Octomber 20th, 2012
TodoMVC port while learning Ember.js to make it easier for everyone, I wrote a simple app so you can understand it just by reading my slides your next step will be to check out the code from this repository after what I would like to invite you to take a look at TodoMVC Ember.js port you should try it and maybe send some patches, hints: refactor some tests update the code with upcoming Ember.js v.1.0 API changes rewrite todo.js model GeekMeet #12, Cluj-Napoca, Transilvania 7 / 19 Octomber 20th, 2012
TodoMVC port while learning Ember.js to make it easier for everyone, I wrote a simple app so you can understand it just by reading my slides your next step will be to check out the code from this repository after what I would like to invite you to take a look at TodoMVC Ember.js port you should try it and maybe send some patches, hints: refactor some tests update the code with upcoming Ember.js v.1.0 API changes rewrite todo.js model GeekMeet #12, Cluj-Napoca, Transilvania 7 / 19 Octomber 20th, 2012
is to point the app where it should append views/content connectOutlets uses {{outlet}}, see below 1 var App = Ember.Application.create({ 2 VERSION: ’0.1.0’, 3 rootElement: ’#content’, 4 ApplicationController: Ember.Controller.extend(), 5 ArticleController: Ember.Controller.extend(), 6 ApplicationView: Ember.View.extend({ 7 template: Ember.Handlebars.compile( ’{{outlet}}’ ) 8 }) 9 // The rest of the Models/Controllers/Views 10 // will self append to this namespace 11 }); GeekMeet #12, Cluj-Napoca, Transilvania 8 / 19 Octomber 20th, 2012
is to point the app where it should append views/content connectOutlets uses {{outlet}}, see below 1 var App = Ember.Application.create({ 2 VERSION: ’0.1.0’, 3 rootElement: ’#content’, 4 ApplicationController: Ember.Controller.extend(), 5 ArticleController: Ember.Controller.extend(), 6 ApplicationView: Ember.View.extend({ 7 template: Ember.Handlebars.compile( ’{{outlet}}’ ) 8 }) 9 // The rest of the Models/Controllers/Views 10 // will self append to this namespace 11 }); GeekMeet #12, Cluj-Napoca, Transilvania 8 / 19 Octomber 20th, 2012
is to point the app where it should append views/content connectOutlets uses {{outlet}}, see below 1 var App = Ember.Application.create({ 2 VERSION: ’0.1.0’, 3 rootElement: ’#content’, 4 ApplicationController: Ember.Controller.extend(), 5 ArticleController: Ember.Controller.extend(), 6 ApplicationView: Ember.View.extend({ 7 template: Ember.Handlebars.compile( ’{{outlet}}’ ) 8 }) 9 // The rest of the Models/Controllers/Views 10 // will self append to this namespace 11 }); GeekMeet #12, Cluj-Napoca, Transilvania 8 / 19 Octomber 20th, 2012
is to point the app where it should append views/content connectOutlets uses {{outlet}}, see below 1 var App = Ember.Application.create({ 2 VERSION: ’0.1.0’, 3 rootElement: ’#content’, 4 ApplicationController: Ember.Controller.extend(), 5 ArticleController: Ember.Controller.extend(), 6 ApplicationView: Ember.View.extend({ 7 template: Ember.Handlebars.compile( ’{{outlet}}’ ) 8 }) 9 // The rest of the Models/Controllers/Views 10 // will self append to this namespace 11 }); GeekMeet #12, Cluj-Napoca, Transilvania 8 / 19 Octomber 20th, 2012
calls define attributes as a computed property it is available for other Ember.js components as well init is the constructor (like new, initialize, construct()) some class methods like: find is part of the conventions and used by router to query a specific model object all is also part of the conventions and used by router to query all available model objects 1 var Article = Ember.Object.extend({ 2 id: null, 3 title: null, 4 content: null, 5 6 // Handle Generation of the slug as a property 7 slug: function() { 8 var slug = this.get( ’title’ ).toLowerCase(); 9 return slug.replace( /\s+?/g, ’-’ ); 10 }.property( ’title’ ).cacheable(), 11 12 // Constructor 13 init: function() { 14 var id = Date.now(); 15 24 Article.reopenClass({ 25 db: {}, 26 27 find: function( id ) { 28 return this.db[ id ]; 29 }, 30 31 all: function() { 32 return this.db; 33 } 34 35 }); GeekMeet #12, Cluj-Napoca, Transilvania 10 / 19 Octomber 20th, 2012
calls define attributes as a computed property it is available for other Ember.js components as well init is the constructor (like new, initialize, construct()) some class methods like: find is part of the conventions and used by router to query a specific model object all is also part of the conventions and used by router to query all available model objects 1 var Article = Ember.Object.extend({ 2 id: null, 3 title: null, 4 content: null, 5 6 // Handle Generation of the slug as a property 7 slug: function() { 8 var slug = this.get( ’title’ ).toLowerCase(); 9 return slug.replace( /\s+?/g, ’-’ ); 10 }.property( ’title’ ).cacheable(), 11 12 // Constructor 13 init: function() { 14 var id = Date.now(); 15 24 Article.reopenClass({ 25 db: {}, 26 27 find: function( id ) { 28 return this.db[ id ]; 29 }, 30 31 all: function() { 32 return this.db; 33 } 34 35 }); GeekMeet #12, Cluj-Napoca, Transilvania 10 / 19 Octomber 20th, 2012
calls define attributes as a computed property it is available for other Ember.js components as well init is the constructor (like new, initialize, construct()) some class methods like: find is part of the conventions and used by router to query a specific model object all is also part of the conventions and used by router to query all available model objects 1 var Article = Ember.Object.extend({ 2 id: null, 3 title: null, 4 content: null, 5 6 // Handle Generation of the slug as a property 7 slug: function() { 8 var slug = this.get( ’title’ ).toLowerCase(); 9 return slug.replace( /\s+?/g, ’-’ ); 10 }.property( ’title’ ).cacheable(), 11 12 // Constructor 13 init: function() { 14 var id = Date.now(); 15 24 Article.reopenClass({ 25 db: {}, 26 27 find: function( id ) { 28 return this.db[ id ]; 29 }, 30 31 all: function() { 32 return this.db; 33 } 34 35 }); GeekMeet #12, Cluj-Napoca, Transilvania 10 / 19 Octomber 20th, 2012
calls define attributes as a computed property it is available for other Ember.js components as well init is the constructor (like new, initialize, construct()) some class methods like: find is part of the conventions and used by router to query a specific model object all is also part of the conventions and used by router to query all available model objects 1 var Article = Ember.Object.extend({ 2 id: null, 3 title: null, 4 content: null, 5 6 // Handle Generation of the slug as a property 7 slug: function() { 8 var slug = this.get( ’title’ ).toLowerCase(); 9 return slug.replace( /\s+?/g, ’-’ ); 10 }.property( ’title’ ).cacheable(), 11 12 // Constructor 13 init: function() { 14 var id = Date.now(); 15 24 Article.reopenClass({ 25 db: {}, 26 27 find: function( id ) { 28 return this.db[ id ]; 29 }, 30 31 all: function() { 32 return this.db; 33 } 34 35 }); GeekMeet #12, Cluj-Napoca, Transilvania 10 / 19 Octomber 20th, 2012
calls define attributes as a computed property it is available for other Ember.js components as well init is the constructor (like new, initialize, construct()) some class methods like: find is part of the conventions and used by router to query a specific model object all is also part of the conventions and used by router to query all available model objects 1 var Article = Ember.Object.extend({ 2 id: null, 3 title: null, 4 content: null, 5 6 // Handle Generation of the slug as a property 7 slug: function() { 8 var slug = this.get( ’title’ ).toLowerCase(); 9 return slug.replace( /\s+?/g, ’-’ ); 10 }.property( ’title’ ).cacheable(), 11 12 // Constructor 13 init: function() { 14 var id = Date.now(); 15 24 Article.reopenClass({ 25 db: {}, 26 27 find: function( id ) { 28 return this.db[ id ]; 29 }, 30 31 all: function() { 32 return this.db; 33 } 34 35 }); GeekMeet #12, Cluj-Napoca, Transilvania 10 / 19 Octomber 20th, 2012
calls define attributes as a computed property it is available for other Ember.js components as well init is the constructor (like new, initialize, construct()) some class methods like: find is part of the conventions and used by router to query a specific model object all is also part of the conventions and used by router to query all available model objects 1 var Article = Ember.Object.extend({ 2 id: null, 3 title: null, 4 content: null, 5 6 // Handle Generation of the slug as a property 7 slug: function() { 8 var slug = this.get( ’title’ ).toLowerCase(); 9 return slug.replace( /\s+?/g, ’-’ ); 10 }.property( ’title’ ).cacheable(), 11 12 // Constructor 13 init: function() { 14 var id = Date.now(); 15 24 Article.reopenClass({ 25 db: {}, 26 27 find: function( id ) { 28 return this.db[ id ]; 29 }, 30 31 all: function() { 32 return this.db; 33 } 34 35 }); GeekMeet #12, Cluj-Napoca, Transilvania 10 / 19 Octomber 20th, 2012
calls define attributes as a computed property it is available for other Ember.js components as well init is the constructor (like new, initialize, construct()) some class methods like: find is part of the conventions and used by router to query a specific model object all is also part of the conventions and used by router to query all available model objects 1 var Article = Ember.Object.extend({ 2 id: null, 3 title: null, 4 content: null, 5 6 // Handle Generation of the slug as a property 7 slug: function() { 8 var slug = this.get( ’title’ ).toLowerCase(); 9 return slug.replace( /\s+?/g, ’-’ ); 10 }.property( ’title’ ).cacheable(), 11 12 // Constructor 13 init: function() { 14 var id = Date.now(); 15 24 Article.reopenClass({ 25 db: {}, 26 27 find: function( id ) { 28 return this.db[ id ]; 29 }, 30 31 all: function() { 32 return this.db; 33 } 34 35 }); GeekMeet #12, Cluj-Napoca, Transilvania 10 / 19 Octomber 20th, 2012
contain a set of other views see childViews, Ember.TextField, Ember.TextArea, Ember.ContainerView, etc. any attribute ending with Binding, upon instantiation will become a binding to that path it is available for other Ember.js components as well ideally, views will generate your HTML (my opinion) views also handle events, see click, insertNewline, etc. 1 var PublishView = Ember.ContainerView.extend({ 2 childViews: [ ’titleView’, ’contentView’, ’buttonView’ ], 3 titleBinding: ’titleView.value’, 4 contentBinding: ’contentView.value’, 5 6 isEmpty: function() { 7 var empty = false; 8 title = this.get( ’title’ ), 9 content = this.get( ’content’ ); 10 11 if ( title && title.trim() === ’’ && content && content.trim() === ’’ ) { 12 empty = true; 13 } 14 15 return empty; 16 }.property( ’title’, ’content’ ), GeekMeet #12, Cluj-Napoca, Transilvania 12 / 19 Octomber 20th, 2012
contain a set of other views see childViews, Ember.TextField, Ember.TextArea, Ember.ContainerView, etc. any attribute ending with Binding, upon instantiation will become a binding to that path it is available for other Ember.js components as well ideally, views will generate your HTML (my opinion) views also handle events, see click, insertNewline, etc. 1 var PublishView = Ember.ContainerView.extend({ 2 childViews: [ ’titleView’, ’contentView’, ’buttonView’ ], 3 titleBinding: ’titleView.value’, 4 contentBinding: ’contentView.value’, 5 6 isEmpty: function() { 7 var empty = false; 8 title = this.get( ’title’ ), 9 content = this.get( ’content’ ); 10 11 if ( title && title.trim() === ’’ && content && content.trim() === ’’ ) { 12 empty = true; 13 } 14 15 return empty; 16 }.property( ’title’, ’content’ ), GeekMeet #12, Cluj-Napoca, Transilvania 12 / 19 Octomber 20th, 2012
contain a set of other views see childViews, Ember.TextField, Ember.TextArea, Ember.ContainerView, etc. any attribute ending with Binding, upon instantiation will become a binding to that path it is available for other Ember.js components as well ideally, views will generate your HTML (my opinion) views also handle events, see click, insertNewline, etc. 1 var PublishView = Ember.ContainerView.extend({ 2 childViews: [ ’titleView’, ’contentView’, ’buttonView’ ], 3 titleBinding: ’titleView.value’, 4 contentBinding: ’contentView.value’, 5 6 isEmpty: function() { 7 var empty = false; 8 title = this.get( ’title’ ), 9 content = this.get( ’content’ ); 10 11 if ( title && title.trim() === ’’ && content && content.trim() === ’’ ) { 12 empty = true; 13 } 14 15 return empty; 16 }.property( ’title’, ’content’ ), GeekMeet #12, Cluj-Napoca, Transilvania 12 / 19 Octomber 20th, 2012
contain a set of other views see childViews, Ember.TextField, Ember.TextArea, Ember.ContainerView, etc. any attribute ending with Binding, upon instantiation will become a binding to that path it is available for other Ember.js components as well ideally, views will generate your HTML (my opinion) views also handle events, see click, insertNewline, etc. 1 var PublishView = Ember.ContainerView.extend({ 2 childViews: [ ’titleView’, ’contentView’, ’buttonView’ ], 3 titleBinding: ’titleView.value’, 4 contentBinding: ’contentView.value’, 5 6 isEmpty: function() { 7 var empty = false; 8 title = this.get( ’title’ ), 9 content = this.get( ’content’ ); 10 11 if ( title && title.trim() === ’’ && content && content.trim() === ’’ ) { 12 empty = true; 13 } 14 15 return empty; 16 }.property( ’title’, ’content’ ), GeekMeet #12, Cluj-Napoca, Transilvania 12 / 19 Octomber 20th, 2012
contain a set of other views see childViews, Ember.TextField, Ember.TextArea, Ember.ContainerView, etc. any attribute ending with Binding, upon instantiation will become a binding to that path it is available for other Ember.js components as well ideally, views will generate your HTML (my opinion) views also handle events, see click, insertNewline, etc. 1 var PublishView = Ember.ContainerView.extend({ 2 childViews: [ ’titleView’, ’contentView’, ’buttonView’ ], 3 titleBinding: ’titleView.value’, 4 contentBinding: ’contentView.value’, 5 6 isEmpty: function() { 7 var empty = false; 8 title = this.get( ’title’ ), 9 content = this.get( ’content’ ); 10 11 if ( title && title.trim() === ’’ && content && content.trim() === ’’ ) { 12 empty = true; 13 } 14 15 return empty; 16 }.property( ’title’, ’content’ ), GeekMeet #12, Cluj-Napoca, Transilvania 12 / 19 Octomber 20th, 2012
contain a set of other views see childViews, Ember.TextField, Ember.TextArea, Ember.ContainerView, etc. any attribute ending with Binding, upon instantiation will become a binding to that path it is available for other Ember.js components as well ideally, views will generate your HTML (my opinion) views also handle events, see click, insertNewline, etc. 1 var PublishView = Ember.ContainerView.extend({ 2 childViews: [ ’titleView’, ’contentView’, ’buttonView’ ], 3 titleBinding: ’titleView.value’, 4 contentBinding: ’contentView.value’, 5 6 isEmpty: function() { 7 var empty = false; 8 title = this.get( ’title’ ), 9 content = this.get( ’content’ ); 10 11 if ( title && title.trim() === ’’ && content && content.trim() === ’’ ) { 12 empty = true; 13 } 14 15 return empty; 16 }.property( ’title’, ’content’ ), GeekMeet #12, Cluj-Napoca, Transilvania 12 / 19 Octomber 20th, 2012
you can define Handlebars.js templates either this way or directly in your HTML file views can also have a layout attribute (see yeild helper ) views can have helpers, see action, log, bindAttr, etc. 1 var ArticleView = Ember.View.extend({ 2 template: Ember.Handlebars.compile( 3 ’<h3>{{content.title}}</h3><p>{{content.content}}</p>’ + 4 ’<a href=”#” {{action goToPublish href=true}}>Publish more!</a>’ 5 ) GeekMeet #12, Cluj-Napoca, Transilvania 13 / 19 Octomber 20th, 2012
you can define Handlebars.js templates either this way or directly in your HTML file views can also have a layout attribute (see yeild helper ) views can have helpers, see action, log, bindAttr, etc. 1 var ArticleView = Ember.View.extend({ 2 template: Ember.Handlebars.compile( 3 ’<h3>{{content.title}}</h3><p>{{content.content}}</p>’ + 4 ’<a href=”#” {{action goToPublish href=true}}>Publish more!</a>’ 5 ) GeekMeet #12, Cluj-Napoca, Transilvania 13 / 19 Octomber 20th, 2012
you can define Handlebars.js templates either this way or directly in your HTML file views can also have a layout attribute (see yeild helper ) views can have helpers, see action, log, bindAttr, etc. 1 var ArticleView = Ember.View.extend({ 2 template: Ember.Handlebars.compile( 3 ’<h3>{{content.title}}</h3><p>{{content.content}}</p>’ + 4 ’<a href=”#” {{action goToPublish href=true}}>Publish more!</a>’ 5 ) GeekMeet #12, Cluj-Napoca, Transilvania 13 / 19 Octomber 20th, 2012
you can define Handlebars.js templates either this way or directly in your HTML file views can also have a layout attribute (see yeild helper ) views can have helpers, see action, log, bindAttr, etc. 1 var ArticleView = Ember.View.extend({ 2 template: Ember.Handlebars.compile( 3 ’<h3>{{content.title}}</h3><p>{{content.content}}</p>’ + 4 ’<a href=”#” {{action goToPublish href=true}}>Publish more!</a>’ 5 ) GeekMeet #12, Cluj-Napoca, Transilvania 13 / 19 Octomber 20th, 2012
probably the most easy (it might be easier in Ruby), so you have no excuse not to write tests! GeekMeet #12, Cluj-Napoca, Transilvania 14 / 19 Octomber 20th, 2012
one library and it’s easy to set up. for cowboys, check out other solutions always try to use tools to save time, in our case, I suggest you to take a look at Phantom.js tests can be run pragmatically, this saves a lot of time! to keep the project sane and healthy, use some continuous integration solution! take a look at: guard-phantomjs-jasmine http://pivotal.github.com/jasmine/ GeekMeet #12, Cluj-Napoca, Transilvania 15 / 19 Octomber 20th, 2012
one library and it’s easy to set up. for cowboys, check out other solutions always try to use tools to save time, in our case, I suggest you to take a look at Phantom.js tests can be run pragmatically, this saves a lot of time! to keep the project sane and healthy, use some continuous integration solution! take a look at: guard-phantomjs-jasmine http://pivotal.github.com/jasmine/ GeekMeet #12, Cluj-Napoca, Transilvania 15 / 19 Octomber 20th, 2012
one library and it’s easy to set up. for cowboys, check out other solutions always try to use tools to save time, in our case, I suggest you to take a look at Phantom.js tests can be run pragmatically, this saves a lot of time! to keep the project sane and healthy, use some continuous integration solution! take a look at: guard-phantomjs-jasmine http://pivotal.github.com/jasmine/ GeekMeet #12, Cluj-Napoca, Transilvania 15 / 19 Octomber 20th, 2012
one library and it’s easy to set up. for cowboys, check out other solutions always try to use tools to save time, in our case, I suggest you to take a look at Phantom.js tests can be run pragmatically, this saves a lot of time! to keep the project sane and healthy, use some continuous integration solution! take a look at: guard-phantomjs-jasmine http://pivotal.github.com/jasmine/ GeekMeet #12, Cluj-Napoca, Transilvania 15 / 19 Octomber 20th, 2012
one library and it’s easy to set up. for cowboys, check out other solutions always try to use tools to save time, in our case, I suggest you to take a look at Phantom.js tests can be run pragmatically, this saves a lot of time! to keep the project sane and healthy, use some continuous integration solution! take a look at: guard-phantomjs-jasmine http://pivotal.github.com/jasmine/ GeekMeet #12, Cluj-Napoca, Transilvania 15 / 19 Octomber 20th, 2012
one library and it’s easy to set up. for cowboys, check out other solutions always try to use tools to save time, in our case, I suggest you to take a look at Phantom.js tests can be run pragmatically, this saves a lot of time! to keep the project sane and healthy, use some continuous integration solution! take a look at: guard-phantomjs-jasmine http://pivotal.github.com/jasmine/ GeekMeet #12, Cluj-Napoca, Transilvania 15 / 19 Octomber 20th, 2012
you are testing use it to describe the test case use beforeEach to DRY aka produce cleaner tests and be fast use multiple describe calls if you want to change the context say, you want to test class methods where before you were testing instance methods 1 describe( ’Article’, function() { 2 3 describe( ’initialization with no values’, function() { 4 var article; 5 6 beforeEach( function() { 7 article = App.Article.create(); 8 } ); 9 10 it( ’has a set of default attributes’, function() { 11 expect( article.get( ’id’ ) ).toMatch( /\d+/ ); 12 expect( article.get( ’title’ ) ).toBeNull(); 13 expect( article.get( ’content’ ) ).toBeNull(); 14 }); 15 16 it( ’throws an exception when calling slug’, function() { 17 expect( function(){ article.get( ’slug’ ) } ).toThrow(); 18 }); 19 20 } ); 21 GeekMeet #12, Cluj-Napoca, Transilvania 16 / 19 Octomber 20th, 2012
you are testing use it to describe the test case use beforeEach to DRY aka produce cleaner tests and be fast use multiple describe calls if you want to change the context say, you want to test class methods where before you were testing instance methods 1 describe( ’Article’, function() { 2 3 describe( ’initialization with no values’, function() { 4 var article; 5 6 beforeEach( function() { 7 article = App.Article.create(); 8 } ); 9 10 it( ’has a set of default attributes’, function() { 11 expect( article.get( ’id’ ) ).toMatch( /\d+/ ); 12 expect( article.get( ’title’ ) ).toBeNull(); 13 expect( article.get( ’content’ ) ).toBeNull(); 14 }); 15 16 it( ’throws an exception when calling slug’, function() { 17 expect( function(){ article.get( ’slug’ ) } ).toThrow(); 18 }); 19 20 } ); 21 GeekMeet #12, Cluj-Napoca, Transilvania 16 / 19 Octomber 20th, 2012
you are testing use it to describe the test case use beforeEach to DRY aka produce cleaner tests and be fast use multiple describe calls if you want to change the context say, you want to test class methods where before you were testing instance methods 1 describe( ’Article’, function() { 2 3 describe( ’initialization with no values’, function() { 4 var article; 5 6 beforeEach( function() { 7 article = App.Article.create(); 8 } ); 9 10 it( ’has a set of default attributes’, function() { 11 expect( article.get( ’id’ ) ).toMatch( /\d+/ ); 12 expect( article.get( ’title’ ) ).toBeNull(); 13 expect( article.get( ’content’ ) ).toBeNull(); 14 }); 15 16 it( ’throws an exception when calling slug’, function() { 17 expect( function(){ article.get( ’slug’ ) } ).toThrow(); 18 }); 19 20 } ); 21 GeekMeet #12, Cluj-Napoca, Transilvania 16 / 19 Octomber 20th, 2012
you are testing use it to describe the test case use beforeEach to DRY aka produce cleaner tests and be fast use multiple describe calls if you want to change the context say, you want to test class methods where before you were testing instance methods 1 describe( ’Article’, function() { 2 3 describe( ’initialization with no values’, function() { 4 var article; 5 6 beforeEach( function() { 7 article = App.Article.create(); 8 } ); 9 10 it( ’has a set of default attributes’, function() { 11 expect( article.get( ’id’ ) ).toMatch( /\d+/ ); 12 expect( article.get( ’title’ ) ).toBeNull(); 13 expect( article.get( ’content’ ) ).toBeNull(); 14 }); 15 16 it( ’throws an exception when calling slug’, function() { 17 expect( function(){ article.get( ’slug’ ) } ).toThrow(); 18 }); 19 20 } ); 21 GeekMeet #12, Cluj-Napoca, Transilvania 16 / 19 Octomber 20th, 2012
you are testing use it to describe the test case use beforeEach to DRY aka produce cleaner tests and be fast use multiple describe calls if you want to change the context say, you want to test class methods where before you were testing instance methods 1 describe( ’Article’, function() { 2 3 describe( ’initialization with no values’, function() { 4 var article; 5 6 beforeEach( function() { 7 article = App.Article.create(); 8 } ); 9 10 it( ’has a set of default attributes’, function() { 11 expect( article.get( ’id’ ) ).toMatch( /\d+/ ); 12 expect( article.get( ’title’ ) ).toBeNull(); 13 expect( article.get( ’content’ ) ).toBeNull(); 14 }); 15 16 it( ’throws an exception when calling slug’, function() { 17 expect( function(){ article.get( ’slug’ ) } ).toThrow(); 18 }); 19 20 } ); 21 GeekMeet #12, Cluj-Napoca, Transilvania 16 / 19 Octomber 20th, 2012