This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
didInsertElement: function() { | |
// any JS inits that need to happen | |
// universally can be called here. | |
// | |
// For example if you need to register | |
// bootstrap dropdowns, you can do something | |
// like $('.dropdown-toggle').dropdown() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
currentlySelectedRestaurant: undefined, | |
actions: { | |
selectRestaurant: function(restaurant) { | |
// The 'sendAction' method is where the magic happens. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
movieService: Ember.inject.service('movie-displayer-service'), | |
currentSelectedMovie: '', | |
didInsertElement: function() { | |
// When the component is inserted into the DOM tree, use the model to set | |
// the 'currentSelectedMovie' property. | |
this.set('currentSelectedMovie', this.get('model').currentSelectedMovie); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
statusObj:{status:false}, | |
actions:{ | |
test(){ | |
console.log('test',this.get('statusObj')); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
childname:'arjun', | |
childage:25, | |
actions:{ | |
changeCname(value){ | |
console.log('changeCname'); | |
this.set('cname',value); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle' | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
cart:Ember.inject.service(), | |
actions:{ | |
addEntry(){ | |
this.get('cart').addEntry(); | |
} | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
isAuthenticated: true, | |
actions: { | |
logIn: function(){ | |
this.toggleProperty('isAuthenticated'); | |
console.log('login application ',this.get('isAuthenticated')); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
didInsertElement(){ | |
this._super(...arguments); | |
console.log('didInsertElement in child-a'); | |
}, | |
didRender(){ | |
this._super(...arguments); | |
console.log('didRender in child-a'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
lang: 'phpurl', | |
actions: { | |
selectOption: function(option) { | |
console.log(option); | |
this.set("lang", option); | |
} | |
} |