Home
Tutorials
Microsoft Technologies Tutorials
Java Programming Tutorials
Web Designing Tutorials
Script Programming Tutorials
Database Programming Tutorials
Mobile Technologies Tutorials
Other Programming Tutorials
Examples
Articles
Tools
News
AngularJS Scope Variables Example
Keywords : Angularjs scopes example, Angularjs scope variable in directive example, Angularjs dynamic scope variables with example, Angularjs use scope variables in controller example
Example
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> AngularJs Scope Object Example </title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> <script type="text/javascript"> var app = angular.module('angularscopeapp', []); app.controller('angularctrl', function ($scope) { $scope.fname = "Welcome to"; $scope.lname = "Tutlane"; $scope.getname = function () { return $scope.fname +" "+ $scope.lname; }; }); </script> </head> <body ng-app="angularscopeapp"> <h2>AngularJS Scope Variables Example</h2> <div ng-controller="angularctrl"> First Name: {{fname}}<br /> Last Name: {{lname}}<br /> Full Name: <b>{{getname()}}</b> </div> </body> </html>
Click Here to See Result
Result
Previous
Next