我们如何将类从html应用到angularjs模板

时间:2018-02-05 08:25:53

标签: html angularjs angularjs-scope

我在angularjs中有我的临时性:

<ul class="pagination">
    <li ng-if="boundaryLinks" ng-class="{ disabled : pagination.current == 1 }"></li>
    <li ng-if="directionLinks" ng-class="{ disabled : pagination.current == 1 }">
        <a href="" ng-click="setCurrent(pagination.current - 1)">
            Previous
        </a>
    </li>
    <li ng-repeat="pageNumber in pages track by $index"
        ng-class="{ active : pagination.current == pageNumber, disabled : pageNumber == \'...\' }">
        <a href="" ng-click="setCurrent(pageNumber)">
            {{ pageNumber }}
        </a>
    </li>
    <li ng-if="directionLinks" ng-class="{ disabled : pagination.current == pagination.last }">
        <a href="" ng-click="setCurrent(pagination.current + 1)">
            Next
        </a>
    </li>
    <li ng-if="boundaryLinks" ng-class="{ disabled : pagination.current == pagination.last }"></li>
</ul>

我的html中的模板

<ul class="pagination">
    <li class="page-item"><a class="page-link" href="#" aria-label="Previous"><span
            aria-hidden="true">&laquo; Prev</span><span
            class="sr-only">Previous</span></a></li>
    <li class="page-item"><a class="page-link" href="#">1</a></li>
    <li class="page-item"><a class="page-link" href="#">2</a></li>
    <li class="page-item active"><a class="page-link" href="#">3</a></li>
    <li class="page-item"><a class="page-link" href="#">4</a></li>
    <li class="page-item"><a class="page-link" href="#">5</a></li>
    <li class="page-item"><a class="page-link" href="#" aria-label="Next"><span
            aria-hidden="true">Next &raquo;</span><span
            class="sr-only">Next</span></a></li>
</ul>

如何在html中使用我的模板中的类到angularjs模板,就像我在第一个脚本中的模板一样?

0 个答案:

没有答案