whenever I click my submit button nothing happens, currently all I want it to do is print out the username and password to test there bindings. And I am able to talk to the controller and print out hard coded message that I made in the controller, it seem's that the ng-click doesn't fire on that method. Any help would be great, Thanks :D
<section id="register-view" class="mainbar">
<section class="matter">
<div class="container">
<div class="row">
<label>{{vm.message}}</label>
<form class="register-form">
<label name="username_label"> Username: </label>
<input type="text" name="username" ng-model="vm.userDetails.username"/>
<br/>
<label name="password_label"> Password: </label>
<input type="text" name="password" ng-model="vm.userDetails.password"/>
<br/>
<button type="submit" class="btn btn-default" ng-click="vm.submitUserDetails()">Submit</button>
</form>
</div>
</div>
</section>
</section>
And controller class
(function () {
'use strict';
angular
.module('app.register')
.controller('RegisterController', RegisterController);
RegisterController.$inject = ['$q', 'dataservice', 'logger'];
/* @ngInject */
function RegisterController($q, dataservice, logger) {
var vm = this;
vm.message = 'baass';
vm.userDetails = {
username: '',
password: ''
}
function activate() {
var promises = [submitUserDetails()];
return $q.all(promises).then(function () {
logger.info('Activated Dashboard View');
});
}
function submitUserDetails() {
console.log('Username: ' + vm.userDetails.username);
console.log('Password: ' + vm.userDetails.password);
}
}
})();