We are providing online training of realtime Live project on Asp.Net MVC with Angular and Web API. For more information click here. If you have any query then drop the messase in CONTACT FORM

Friday, April 27, 2018

How to pass the data from controller to view without using $scope in AngularJs

<script src="~/Scripts/angular.js"></script>
<script type="text/javascript">
    angular.module('myApp', [])
    .controller('MyCtrl', [function () {
        this.FirstName = 'Mithilesh ';
        this.LastName = 'Kumar ';
    }]);
</script>

<body ng-app="myApp" ng-controller="MyCtrl as ctrl">
    <b>Full Name:</b>  {{ctrl.FirstName}}
    {{ctrl.LastName}}


</body>
Output:



No comments: