How To Pass Data From AngularJs Controller To HTML Page Script [Resolved]

Posted by Kasani007 under AngularJS on 10/31/2016 | Points: 10 | Views : 131 | Status : [Member] | Replies : 1
I Have AngularJS Controller, Which had $scope Object With Some data,i.e.,
$scope.Student;
Now I want to assign that data to Html page having script as below

 <script type="text/javascript">
var stdId=$scope.Student.StudentId;
var stdName=$scope.Student.StudentName;
</script>


thanks n regards,
Chaitanya




Responses

Posted by: Kasani007 on: 11/1/2016 [Member] Starter | Points: 25

Up
0
Down

Resolved
To Pass The $scope Object From A Controller To Outer Control, Then We Have To use

var scope = angular.element($("#OuterControlId")).scope();

The Outer Control May Be TextBox,Label Or ReportViewer Anything else..we can handle data with the above code from controller.

Kasani007, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response