html - Angular : template changing depending on javascript value -
i building angular app, templates changing depending on ngscope seen on samples below.
<label class="btn btn-default"> <input id="cacher" value="settings" type="radio" data-ng-model="user.status">settings </input> </label>
and here i'm calling html template userpagesettings
<div id="wrapper" ng-switch="user.status"> <div ng-switch-when="settings"> <user-page-settings></user-page-settings> </div> </div>
trouble is, i'm trying access templates (and correct route) through dropdown in navbar, supposed same thing normal menu. if call templates navbar shown on current page, therefore @ incorrect route.
in navbar code i'm doing following, bringing me correct route, showing me default template (aka home, not shown here, called through same method , has number 6)
<li role="menuitem"><a href="/user/:username/1">settings</a></li>
the number "1" (and others using 2,3 etc) hashed in javascript , put variable. make templates appear depending on numbers.
any ideas how ?? :) thank !!
Comments
Post a Comment