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 Controller Function Example
Keywords : Angularjs controller functions return value example, Angularjs controller with methods example, Angularjs controller function with parameters example, Angularjs call functions in controller
Example
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> AngularJs Controller with Function 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('angularctrlapp', []); app.controller('angularctrl', function ($scope) { $scope.fname = "Welcome to"; $scope.lname = "Tutlane"; $scope.getname = function () { return $scope.fname +" "+ $scope.lname; }; }); </script> </head> <body> <h2>AngularJS Controller with Functions Example</h2> <div ng-app="angularctrlapp" 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