Created
April 30, 2015 22:45
-
-
Save koryteg/78378279349a2c604a3c to your computer and use it in GitHub Desktop.
service objects
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' | |
var ApplicationController = Ember.Controller.extend({ | |
settings: Ember.inject.service(), | |
updateCurrentPath: funtion(){ | |
this.set('settings.currentPath', this.get("currentPath") ); | |
}.observes("currentPath") | |
export default ApplicationController; |
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' | |
var CampaignsController = Ember.ArrayController.extend({ | |
settings: Ember.inject.service(), | |
onNew: function(){ | |
// checking if we are on campaigns/new route | |
if (this.get("settings.currentPath").indexOf("new") > -1){ | |
return true | |
} | |
}.property('settings.currentPath') | |
}) |
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' | |
var SettingsService = Ember.Object.extend({ | |
currentPath: 'null' | |
}) | |
export default SettingsService; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment