I am trying to set the value of a $scope property using ng-init, and I am unable to access that value in the controller\'s javascript. What am I doing wrong? Here is a fidd
Just set ng-init as a function. You should not have to use watch.
{{ testInput }} app.controller('MainCtrl', ['$scope', function ($scope) { $scope.testInput = null; $scope.init = function(value) { $scope.testInput= value; } }]);
Here's an example.
Plunker