Created
January 10, 2017 03:46
-
-
Save wnghdcjfe/4e7bacabc549b1afb9ecda445dc3260d to your computer and use it in GitHub Desktop.
angular js filter img tag
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.filter('findImg', function(){ | |
return function(item){ | |
//?은 바로 앞의 문자가 있거나 없거나를 판단 | |
//예를 들자면 홍철?영주 >> 영주 또는 홍철영주를 반환한다. | |
var reg1 = item.match(/src=\"(.+?)\"/i); | |
//var reg1 = item.match(/src=[\"](.+?)[\"].*?/i); | |
var reg2 = reg1[0].split('"'); | |
return reg2[1]; | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment