問題を解決するのを手伝ってください。属性にフィルタを適用する方法は?
テキストのカスタムフィルタを作成します。
<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:最初のケースのI出力にMYTEXTとフィルタを適用するには、結果が
HTML OKです、私は後者の場合のために、このフィルタを適用する必要がある
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();
}
}]);