-
-
Save smile921/2822292dd30c68c82cf3b0bf6b813da1 to your computer and use it in GitHub Desktop.
Data Binding
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.Route.extend({ | |
activate() { | |
document.body.classList.add('standard'); | |
} | |
}); |
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'; | |
import get from 'ember-metal/get'; | |
import set from 'ember-metal/set'; | |
export default Ember.Component.extend({ | |
actions: { | |
change() { | |
// this.toggleProperty('model'); | |
set(this, 'model', { | |
state: !get(this, 'model.state') | |
}); | |
} | |
} | |
}).reopenClass({ positionalParams: ['model'] }); |
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({ | |
tagName:'section', | |
actions:{ | |
show_demo_sub:function(demo){ | |
console.log(demo); | |
} | |
} | |
}).reopenClass({positionalParams:['demo_sub']}); |
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({ | |
tagName:'div.p' | |
}).reopenClass({positionalParams:['api']}); |
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'; | |
import get from 'ember-metal/get'; | |
import set from 'ember-metal/set'; | |
export default Ember.Controller.extend({ | |
actions: { | |
change() { | |
this.toggleProperty('model.state'); | |
} | |
} | |
}); |
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.Route.extend({ | |
model() { | |
return { | |
state: true | |
}; | |
} | |
}); |
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
*, *::before, &::after { | |
box-sizing: border-box; | |
} | |
strong { | |
color: red; | |
font-size: 1.2rem; | |
} |
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
{ | |
"version": "0.10.5", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": true, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "//cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.js", | |
"hack": "//cdnjs.cloudflare.com/ajax/libs/hack/0.7.7/hack.css", | |
"standard": "//cdnjs.cloudflare.com/ajax/libs/hack/0.7.7/standard.css", | |
"ember": "2.6.2", | |
"ember-data": "2.6.2", | |
"ember-template-compiler": "2.6.2", | |
"ember-testing": "2.6.2" | |
}, | |
"addons": { | |
"ember-route-action-helper": "2.0.0", | |
"ember-truth-helpers": "1.2.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how to implement so that the input change then the model change ,is this duble data binding ?