Angularjs $scope is nothing but just api data showed view file. I will Explain.
The controller creates two properties (variables) in the scope (firstName and lastName).
The ng-model directives bind the input fields to the controller properties (firstName and lastName).
$scope.mysite= 'devtotricks.blogspot.com'
}
</script>
HTML Code:
<div ng-controller="ControllerName">
<p>{{data.Name}}</p>
<p>{{data.mysite}}</p>
output:
Dev2tricks
devtotricks.blogspot.com
or
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.Name= "Dev2tricks";
$scope.mysite= "devtotricks.blogspot.in";
});
</script>
<div ng-app="myApp" ng-controller="myCtrl">
Name: <input type="text" ng-model="Name"><br>
Mysite: <input type="text" ng-model="mysite"><br>
<br>
Details: {{Name+ " " + mysite}}
</div>
Output
Details : Dev2tricks devtotricks.blogspot.in
3 comments
commentsNice. But Can you explain some more deeply...
ReplyNice. But Can you explain some more deeply...
ReplyThis script brings the datas. If any more get me at methababublog@gmail.com
Reply