Includes application module
app.js
var appProfileDetails = angular.module('profileDetailsApp', [ 'ngMaterial','ngAria','ngAnimate','ngRoute']);
This module contains the controller file
contactController.js
appProfileDetails.controller('contactController', function($scope) { $scope.msg= function() { alert($scope.emailId); }; });
Html snippet for contact page (Contact.jsp)
<div ng-app="profileDetailsApp"> <div style="float: left;margin-left: 50px;width: 45%;" ng-controller="contactController" > <div ng-include="'/mm/resources/html/ContactDetails2.html'"> </div> </div>
The following file is included in the above code snippet
ContactDetails2.html
<div> <input type="email" ng-model="emailId"/> <input type="button" ng-click="msg()"/> </div>