Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49186

Dynamic TemplateUrl based on User Role

$
0
0

@zahrani wrote:

Hi ,

i have the following code :

.state('service_tab.home', {
url: '/home',
views: {
'service_home-tab': {
//templateUrl: 'templates/staff/service_home.html',
templateUrl: function() {
if (false) {
return "templates/staff/service_home.html";
}
else {
return "templates/student/service_home.html";
}
},
controller: 'service_HomeTabCtrl'
}
} ,
data: {
authorizedRoles: [USER_ROLES.staff ]
}
})

the above code only works if the condition is True ,
i need to dynamically redirect the user based on the USER_ROLES

thank you

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 49186

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>