Firebase example
$ ember new chat
$ cd chat/
$ npm install --save emberfire
$ npm install -g firebase-tools
$ firebase init
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
mustaches:'mustaches' | |
}); |
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle', | |
wrapped: false, | |
wrapper: Ember.computed('wrapped', { | |
get() { | |
return this.get('wrapped'); | |
}, | |
set(key,value) { |
// app/controllers/sign-in.js | |
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
actions: { | |
signIn(){ | |
this.set('errors', null); | |
var params = { identification: this.get('email'), password: this.get('password') }; | |
// Redirects to index route on success (configurable in config/environment.js) | |
this.get('session').authenticate('simple-auth-authenticator:oauth2-password-grant', params); |
// tests/acceptance/foo-test.js | |
// Assert that text should be found | |
assert.hasText('Not Found'); // Error: Could not find text "Not Found" on the page | |
// Provide custom message | |
assert.hasText('Not Found', 'Expected to find "Not Found"'); // Error: Expected to find "Not Found" | |
// Find any number of elements containing the query text | |
text('Found'); // [<div>Found</div>, <input value="Found">] |
// tests/test-helper.js | |
import QUnit from 'qunit'; | |
QUnit.assert.trimEq = function(actual, expected) { | |
var trimActual = actual.replace(/^\s+|\s+$/g,''); | |
this.equal(trimActual, expected); | |
}; | |
// tests/unit/components/*.js | |
assert.trimEq(this.$().text(), 'foo'); |
Firebase example | |
## Init | |
``` | |
$ ember new chat | |
$ cd chat/ | |
$ npm install --save emberfire | |
$ npm install -g firebase-tools | |
$ firebase init |