无法读取角度js中未定义的属性“substring”

时间:2017-11-01 07:14:22

标签: javascript jquery angularjs

请帮帮我 错误无法读取角度js中未定义的属性“substring”

myApp.controller('helpcontoller', ['$scope','$element','$log',
function ($scope, $element, $log, $attr, str) {
 var myElements = $( ".helppageurl" );
 for(i = 0; myElements.length>0; i++){
     var gethref = $(myElements[i]).attr('src');
     var res = gethref.substring(5);
     myElements[i].setAttribute('src', res); 

 }
 }
 ]);

0 个答案:

没有答案