[appSwitcher] check for chrome on $scope
This commit is contained in:
parent
16165d6c5b
commit
344aed432d
|
@ -1,4 +1,5 @@
|
|||
var parse = require('url').parse;
|
||||
var bindKey = require('lodash').bindKey;
|
||||
|
||||
require('../appSwitcher/appSwitcher.less');
|
||||
|
||||
|
@ -9,7 +10,15 @@ require('ui/modules')
|
|||
restrict: 'E',
|
||||
template: require('./appSwitcher.html'),
|
||||
controllerAs: 'switcher',
|
||||
controller: function () {
|
||||
controller: function ($scope, $window) {
|
||||
|
||||
// since we render this in an isolate scope we can't "require: ^chrome", but
|
||||
// rather than remove all helpfull checks we can just check here.
|
||||
if (!$scope.chrome || !$scope.chrome.getNavLinks) {
|
||||
throw new TypeError('appSwitcher directive requires the "chrome" config-object');
|
||||
}
|
||||
|
||||
this.getNavLinks = bindKey($scope.chrome, 'getNavLinks');
|
||||
|
||||
// links don't cause full-navigation events in certain scenarios
|
||||
// so we force them when needed
|
||||
|
|
Loading…
Reference in a new issue