Maison  >  Questions et réponses  >  le corps du texte

angular.js - AngularJS自定义指令,加入replace属性就出错,不能正常显示,求教啊

这是我的代码,求教!

  <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>'
    };

});

伊谢尔伦伊谢尔伦2713 Il y a quelques jours696

répondre à tous(1)je répondrai

  • PHP中文网

    PHP中文网2017-05-15 17:12:40

    @someAttr是啥,@myUrl?

    répondre
    0
  • Annulerrépondre