When working on an angularjs application, one task may be to convert a string to uppercase. There are 2 options available to achieve this, both yielding the same result. However, it is important to consider the scenarios in which one option may be preferred over the other, particularly in terms of performance.
Option 1: CSS text-transform property
<!DOCTYPE html>
<html>
<head>
<body>
<div style ="text-transform: uppercase">The text-transform uppercase Property</div>
</body>
</html>
Option 2: Angularjs filter
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js">
</script>
<body>
<div ng-app="myApp" ng-controller="caseCtrl">
{{txt | uppercase}}
</div>
<script>
var app = angular.module('myApp', []);
app.controller('caseCtrl', function($scope) {
$scope.txt = "Angularjs uppercase filter";
});
</script>
</body>
</html>