包含應用模塊
app.js
var appProfileDetails = angular.module('profileDetailsApp', [ 'ngMaterial','ngAria','ngAnimate','ngRoute']);
它具有控制器文件
contactController.js
appProfileDetails.controller('contactController', function($scope) { $scope.msg= function() { alert($scope.emailId); }; });
的Html片(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>
ContactDetails2.html
<div> <input type="email" ng-model="emailId"/> <input type="button" ng-click="msg()"/> </div>
該文件包括在上述片
我無法在警報框中獲得電子郵件的價值..任何人都可以幫助我嗎? –
你期待的代碼是什麼?它究竟在做什麼?有沒有錯誤信息?如果您需要幫助,您需要發佈所有這些信息 – millerbr
在contact.jsp中,我包含了Contactdetails2.html,並且在那裏使用了電子郵件和一個按鈕輸入類型。點擊按鈕後,我想在警告框中看到電子郵件。 –