Just getting started with AngularJs and encountering an issue with passing a value from a .Net MVC View to an AngularJs Controller. Here's the code snippet in question:
AngularJs controller snippet:
app.controller("RatingApiController", function ($scope, RatingApiService) {
var id = $scope.roomId;
})
MVC View snippet:
<div id="tblSubs" ng-controller="RatingApiController" >
<span ng-init="roomId = @ViewBag.roomId">something</span>
</div>
What is the best approach to access the roomId value from the Mvc View inside the id variable within the AngularJs controller?