Reputation: 15006
Retreiveing a value like {{cat}} from angular, is there a way to set a value that will output if no value is in the $scope
?
Upvotes: 0
Views: 63
Reputation: 43947
Not sure if you want to do something like this:
<div ng-init="cat = cat || 'Tom Cat'">{{cat}}</div>
If you are not looking to initialize but just want to display it:
<div>{{cat || "Tom Cat"}}</div>
Upvotes: 5