javascript - Questions on ngshow and scope -
i have 2 question on angularjs, use differents sections , want show 1 did : <section ng-show="section6_us"> </section>
, <section ng-show="section7_us"> </section>
exemple , have lot of variable in scope.
can thing ? <section ng-show="{section6_us == "section6"}"> </section>
, <section ng-show="{section7_us == "section7"}"> </section>
variable , compare ? great because can't use ng-switch , ng-if , have lots of variable section1,section2,...section 14 etc.
second, it's possible can use scope ? $scope.("section"+i) = true
example ?
thank in advance ben
i not sure trying here per understanding:
it should differnt quotes.
note have used single denote value
<section ng-show="{section7_us == 'section7'}"> </section>
plus store dynamic properties , can use square brackets: like:
$scope["section"+i] = true;
this no angular, plain javascript objects property addition.
Comments
Post a Comment