I am completely puzzled by this issue: I have a Angular app and I'm trying to update the class using a simple JavaScript string update where the class name is bound to the DOM. The strange thing is that in my application, the most basic statement for changing the text doesn't work, but if I execute the exact same line in the Chrome console, the text does change. Why is this statement not functioning within my app? Is there some other factor at play or am I overlooking something?
$scope.changesize = function() {
var fsize = $scope.form_size.split("-").pop(); // "form-group-xs";
if (fsize == "xs") {fsize = "sm"}; //fsize = "xs";
if (fsize == "sm") {fsize = "md"};
if (fsize == "md") {fsize = "lg"};
if (fsize == "lg") {fsize = "xs"};
$scope.form_size = "form-group-" + fsize;
console.log($scope.form_size); // returns "form-group-xs" !!??!!!?!
}
Here is a screenshot from my console as evidence: https://i.sstatic.net/B5JX5.jpg