angular.js - AngularJS自定义指令,加入replace属性就出错,不能正常显示,求教啊
伊谢尔伦
伊谢尔伦 2017-05-15 17:10:40
0
1
691

这是我的代码,求教!

  <input type="text" ng-model="theirUrl"> 
  <p some-attr="{{theirUrl}}" my-text="Click me" my-directive>

  </p>

angular.module("app",[]).directive('myDirective',function(){
    return {
        restrict:'AE',
        scope:{
            myUrl: '@someAttr',
            myText:'@'
        },
        template:'<input type="text" ng-model="myUrl"/><br><a href="{{myUrl}}">{{myText}}</a>'
    };

});

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

répondre à tous(1)
Ty80

@someAttr是啥,@myUrl?

Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!