Declare multiple values in ng-init
Sometimes its not ideal to put the variables in a function. For example your backend is in express and you are rendering a file using jade.
With Express.js you can send local variables to the html. Angular can accept these variables with
ng-init=""
Using ";" one can have multiple variables
Example
ng-init=" hello='world'; john='doe' "
Use a function, way more readable:
ng-init="init()"
And:
$scope.init = function() {
$scope.a = 1;
$scope.b = 2;
}
Or, if you must, separate inline variables with a semi-colon:
ng-init="a = 1; b = 2"