This file contains 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
createRegularPayment: (period) -> | |
payment = @get('store').createRecord('RegularPayment', | |
{ | |
period: period.period | |
date: period.date | |
}) | |
template = @get('store').createRecord('paymentTemplate', | |
{ | |
title: @get('paymentTitle') |
This file contains 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
createRegularPayment: (period) -> | |
payment = @get('store').createRecord('RegularPayment', | |
{ | |
period: period.period | |
date: period.date | |
}) | |
payment.save().then (regular) -> | |
console.log 'here' | |
template = @get('store').createRecord('paymentTemplate', | |
{ |
This file contains 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
Application = Ember.Route.extend | |
model: (_, transition)-> | |
@_needsAuth(transition.targetName) and @store.find('user', 'current').catch( => | |
@transitionTo('sign_in') | |
Ember.RSVP.resolve() | |
) |
This file contains 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
needs: 'application'.w() | |
... | |
currentUser = @get('controllers.application.model') |
This file contains 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
initialize: (container, application)-> | |
shared = container.lookup('globals:shared') | |
shared.set('auth.token', window.localStorage.auth_token) |
This file contains 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
initialize: (container, application)-> | |
sharedStore = Ember.Object.create() | |
auth = Ember.Object.extend | |
token: null | |
currentUser: (-> | |
result = application.LoginLogic.retrieveCurrentUser(@get('token')) | |
if result |
This file contains 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
Ember.Application.initializer({ | |
name: 'authenticated-routes', | |
after: 'simple-auth', | |
initialize: function(container, application) { | |
var routeNames = Object.keys(Teachertrainingv2.Router.router.recognizer.names), | |
routeObj = null; | |
var systemRoutes = ['loading', 'error', 'application']; | |
var routesWithoutAuth = systemRoutes.concat(Teachertrainingv2.ROUTES_NOT_REQUIRE_AUTHENTICATION); |
This file contains 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 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', | |
actions: { | |
insert(){ | |
// set timeout is used intentionally | |
// (instead of Ember.run.later) | |
setTimeout(()=>{ |
OlderNewer