在Angular中将范围设置为模板中当前范围的子项

时间:2014-01-31 20:04:19

标签: angularjs

说我有一个这样的模板:

<div id="player" ng-show="player.is_visible">
  <p ng-class="player.foo_class">...</p>
  <p ng-class="player.bar_class">...</p>
  <p ng-class="player.baz_class">...</p>
<div>

如何缩小#player内的范围呢?

<div id="player" ng-show="player.is_visible" ng-inner-scope="player">
  <p ng-class="foo_class">...</p>
  <p ng-class="bar_class">...</p>
  <p ng-class="baz_class">...</p>
<div>

0 个答案:

没有答案