Bitte helfen Sie das Problem zu lösen.Wie man einen Filter für ein Attribut anwendet?
Ich schreibe benutzerdefinierten Filter für Text. in ersten Fall i Ausgang myText und Filter anwenden, ist das Ergebnis OK
html:
<div ng-app="main4">
<md-content ng-controller="main4Ctrl">
<h2 class="md-display-1 ng-binding">Главная страница 3</h2>
<sapn id="firstCase">{{myText | transform}}</sapn> - it worked
<hr>
<span id="secondCase" ng-bind-html="myText"/> - but it not worked
</md-content>
</div>
js:
angular.module('main4', [])
.controller('main4Ctrl', ['$rootScope', '$scope', '$timeout',
function($rootScope, $scope, $timeout) {
$scope.myText = 'qWeRtYuIoP';
}
]).filter('transform',[function(){
return function(text){
return transformTetx = text.toLowerCase();
}
}]);
ich anwenden muß diese Filter für die zweiten Fall