-
-
Save nishanmiranda/2e0544f2edc1c05fb924ed75877d9b49 to your computer and use it in GitHub Desktop.
client side data integrity
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({ | |
}); |
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 { typeOf } from '@ember/utils'; | |
export default Ember.Controller.extend({ | |
init() { | |
this._super(...arguments); | |
let model = {}; | |
Object.defineProperty(model, 'data', { | |
writable: false, | |
configurable: true, | |
value: 'Goku' | |
}); | |
this.set('model', model); | |
Ember.onerror = function(error) { | |
if (typeOf(error) === 'error') { | |
alert(error); | |
} | |
} | |
}, | |
appName: 'Ember Twiddle', | |
actions: { | |
focusIn(property) { | |
Object.defineProperty(this.get('model'), property, { | |
writable: true | |
}); | |
}, | |
focusOut(property) { | |
Object.defineProperty(this.get('model'), property, { | |
writable: false | |
}); | |
}, | |
change() { | |
this.set('model.data', this.get('model.data') + this.get('model.data')); | |
}, | |
send() { | |
alert(`${this.get('model.data')} is sent to server`); | |
} | |
} | |
}); |
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.15.0", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js", | |
"ember": "3.2.2", | |
"ember-template-compiler": "3.2.2", | |
"ember-testing": "3.2.2" | |
}, | |
"addons": { | |
"ember-data": "3.2.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment