我的angularjs页面中有一个电子邮件文本框,如下所示:
<div class="form-group form-control-default required">
<input type="email" class="form-control" ng-model="signUpParams.email" name="email" id="InputEmail1" placeholder="Email" required> </div>
我想显示在ng对话框中输入的电子邮件。这是我的ng-dialog脚本标签的一部分:
<script type="text/ng-template" id="templateId">
<div class="media-body act-media-body">
<h5 class="success" style="color:#84b642">Now it is time to complete this process</h5>
<p class="margin-v-35-0">Thank you for signing up for your account. to complete this process you have to confirm by clicking the link we have mailed to your mail account : [email protected]</p>
</div>
</script>
我想更换[email protected]在p标签与inputed电子邮件静态数据。我怎样才能做到这一点?有什么帮助吗?谢谢
已编辑
这是我的控制器代码来调用ng-dialog:
var loginModule = angular.module('loginModule', ['ngDialog']);
loginModule.controller('loginController', function($scope, $http, $window, ngDialog) {
$scope.signUp = function() {
$http.post("/users/createUser",$scope.signUpParams)
.success(function(response)
{
if(response.status){
if(response.isUserExists){
alert(response.message);
}else if(response.isMailSendSuccessfully){
ngDialog.open({ template: 'templateId',
closeByDocument : false,
preCloseCallback: function(value) {
$window.location.href="/"
}
});
}
}else{
//SOMETHING WENT WRONG
alert(response.message);
}
}).error(function(data, status, headers, config) {
alert(data)
});
};
更新呼叫以ngDialog.open
包括您的范围:
ngDialog.open({ template: 'templateId',
closeByDocument : false,
preCloseCallback: function(value) {
$window.location.href="/"
},
scope: $scope
});
现在,您可以在对话框中引用模型:
<p class="margin-v-35-0">Thank ... : {{signUpParams.email}}</p>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句