I put data in the ng-init then I want to receive these value for my controller.
<div ng-controller='hotelDetailCtrl' data-ng-init="mytest='hello'" class="col-sm-9 col-lg-9" >
app.controller('hotelDetailCtrl', function ($scope, $http) {
$scope.init = function(){
alert($scope.mytest);
};
});
But I can't get these value from my controller.Please help me and then explain about these case.
console.log($scope.mytest);inside your controllerdetailUrl? where is$scope.init()called?