My image code looks like this:
console.log( $scope.image ); // <img alt="hello" class="form" src="demo.jpg">
I am trying to extract just the text of alt
:
console.log( $scope.image ); // hello
I came across a solution for jQuery here, but I need to achieve the same in AngularJS. Any suggestions?
Edit: It's worth noting that $scope.image
contains additional HTML elements as well.