Skip to content

Instantly share code, notes, and snippets.

@koryteg
Created April 30, 2015 22:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koryteg/78378279349a2c604a3c to your computer and use it in GitHub Desktop.
Save koryteg/78378279349a2c604a3c to your computer and use it in GitHub Desktop.
service objects
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;
{{#if onNew}}
<!--add some content for the new route -->
{{else}}
<!--add some content for campaigns route that you dont want on the new route. -->
{{/if}}
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')
})
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