-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow for consuming app to define header appName
- Loading branch information
Showing
2 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,25 @@ | ||
/** | ||
* @property appName is a computed property that first checks the consuming app config/environment.js | ||
* for APP.bonfire.title | ||
* APP: { | ||
* bonfire: { | ||
* title: 'Your App Name' | ||
* } | ||
* } | ||
* If this is not provided then it will fetch from application.namespace.name | ||
*/ | ||
|
||
import Ember from 'ember'; | ||
import layout from '../templates/components/bf-header'; | ||
|
||
export default Ember.Component.extend({ | ||
layout: layout, | ||
appName: function() { | ||
return Ember.String.capitalize(this.get('application.namespace.name')); | ||
var configTitle = this.container.lookupFactory('config:environment').APP.bonfire.title; | ||
if (Ember.isEmpty(configTitle)) { | ||
return Ember.String.capitalize(this.get('application.namespace.name')); | ||
} else { | ||
return configTitle; | ||
} | ||
}.property('application.namespace.name') | ||
}); |
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