Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save padhyakash/85878d28ff617987072b1c940aed413b to your computer and use it in GitHub Desktop.
Save padhyakash/85878d28ff617987072b1c940aed413b to your computer and use it in GitHub Desktop.
HTML:
<div id="content">
<div class="topcontent3">
<div class="ad-container">
<md-card aria-label="Obmondo" class="login-card">
<form name="createUser" ng-submit="ctrl.createUser(user)" novalidate>
<md-card-header class="color2">
<md-card-header-text>
<span class="md-title">Create User</span>
</md-card-header-text>
</md-card-header>
<md-card-content>
<md-input-container class="md-block">
<!-- Use floating placeholder instead of label -->
<input name="name" ng-model="user.att_name" type="text" placeholder="Name" ng-required="true">
<div ng-messages="createUser.name.$error">
<div ng-message="required">This is required.</div>
</div>
</md-input-container>
<md-input-container class="md-block">
<!-- Use floating placeholder instead of label -->
<input name="email" ng-model="user.att_email" type="email" placeholder="Email (required)"
ng-required="true"
minlength="4" maxlength="100" ng-pattern="/^.+@.+\..+$/"/>
<div ng-messages="createUser.email.$error" role="alert">
<div ng-message-exp="['required', 'minlength', 'maxlength', 'pattern']">
Email address is invalid
</div>
</div>
</md-input-container>
<md-input-container class="md-block">
<!-- Use floating placeholder instead of label -->
<input name="password" ng-model="user.password" type="password" placeholder="Password" ng-required="true">
<div ng-messages="createUser.password.$error">
<div ng-message="required">This is required.</div>
</div>
</md-input-container>
<md-input-container class="md-block" ng-show="$root.global.role">
<!-- Use floating placeholder instead of label -->
<input name="customer_id" ng-model="user.id" type="text" placeholder="Customer ID" ng-required="true"/>
<div ng-messages="createUser.customer_id.$error">
<div ng-message="required">This is required.</div>
</div>
</md-input-container>
<md-input-container class="md-block" ng-hide="$root.global.role">
<input ng-model="user.id" ng-readonly="true" ng-value="$root.global.customer_id" aria-label="Readonly field"/>
</md-input-container>
<p class="text-center"><md-button class="md-raised md-accent text-center" type="submit">CREATE USER</md-button></p>
</md-card-content>
</form>
</md-card>
</div>
</div><!-- end of topcontent3 -->
</div>
controller:
this.createUser = function (user) {
console.log(user);
Auth.createUser(user)
.then(function (response) {
console.log(response,'ddd');
if (response.status === 200) {
toastr.success('UPDATE SUCCESSFUL', 'Success');
$location.path('/');
}
})
};
response of line no: 67
att_email: "akash.padhy@enableit.dk",
att_name: "dsdsdsd",
password: "testpass"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment