angular.js - Character interception for links in href in angular?
PHPz
PHPz 2017-05-15 17:07:09
0
1
767

1. When using angular and encountering two levels of ng-repeat nesting, use

 <ul class="circle-list" ng-model="imgarry">
    <li ng-repeat="masnum in news">
        <p class="msgs_p">
           <p ng-if="!masnum.shows"  class="shows" ng-bind-html="masnum.content | cut:true:80:''"></p>
           <p ng-if="masnum.shows" class="shows_hover" ng-bind-html="masnum.content"></p>
        </p>
        <p class="msg_imgs2" ng-switch-when="2">
             <ul> 
                <li ng-repeat="nums in masnum.pics" > 
                    <a href={{nums}} class="swipebox" style="background:url({{nums}}) center center;background-size:cover" ></a>
                </li>
        </p
    </li>
 </ul>

Among them, nums is the image path returned by the server, for example: http://image.wquan.net/201603...
I now need to obtain the domain name of this link address eg: http://image .wquan.net and the "-" character in this domain name address, and then intercept the parameters after the "-". How to do it in ng-repeat? Do I need to define a method on the a tag? ?

PHPz
PHPz

学习是最好的投资!

reply all(1)
迷茫

You can write a filter yourself

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template