can we add check undefined
value in ng-init
.? if there is value in scope then print it else print foobar
. Currently, it should print foobar
can we add a condition in ng-init
?
here is my code http://plnkr.co/edit/bFbAWXq6dKdkxWAxp7v8?p=preview
<body ng-controller="MainCtrl" ng-init="test|| 'foobar'">
<p>Hello {{test}}!</p>
</body>