After encountering a problem with my HTML/JS/Angular script, I created a simple demo to illustrate the issue. Although I have found a solution, I still wanted to seek advice from experts.
<body ng-app>
<div ng-controller='abc'>
<h1 ng-click='title= "A B C D EFGH";'>{{title}} </h1>
</div>
</body>
Angular Code:
function abc($scope) {
$scope.title = 'Hello World';
};
Upon clicking: The continuous spaces within the string are replaced with a single space. Result: "A B C D EFGH"
Why is this behavior happening?