I want to create a piece of HTML with AngularJS based on the authentication status.
I use ng-switch.
The issue is that I want to have multiple hits
Someone overwrote the ngSwitchWhen Directive to include the option to allow || operators, you can find the original response here: http://docs.angularjs.org/api/ng.directive:ngSwitch by angabriel
config(function($routeProvider, $provide) {
/**
* overwrite angular's directive ngSwitchWhen
* can handle ng-switch-when="value1 || value2 || value3"
*/
$provide.decorator('ngSwitchWhenDirective', function($delegate) {
$delegate[0].compile = function(element, attrs, transclude) {
return function(scope, element, attr, ctrl) {
var subCases = [attrs.ngSwitchWhen];
if(attrs.ngSwitchWhen && attrs.ngSwitchWhen.length > 0 && attrs.ngSwitchWhen.indexOf('||') != -1) {
subCases = attrs.ngSwitchWhen.split('||');
}
var i=0;
var casee;
var len = subCases.length;
while(i