javascript - NgSubmit isn't working -
i'm working on web app laravel backend , angularjs frontend. first time in angularjs. here's code
login.php
<html ng-app="liquor"> <!--head--> <body> <div class="container"> <div class="center-block row"> <div ng-controller="logincontroller"> <form novalidate name="loginform" ng-submit="attempt()"> <div class="form-group"> <input type="text" ng-required="true" ng-model="username" name="username" class="form-control" type="text" placeholder="user name" autofocus="true"/> <input type="password" ng-required="true" name="password" ng-model="password" class="form-control" type="text" placeholder="password"/> <input type="checkbox" name="rememberme" ng-model="rememberme" /> <small>remember me</small> <br/> <button type="submit" name="submit" class="btn">login</button> </div> </form> </div> </div> </div> <script src="js/angular.min.js"></script> <script src="js/app.js"></script> <script src="js/controllers/logincontroller.js"></script>
app.js
var liquor = angular.module('liquor',[]);
logincontroller.js
liquor.controller('logincontroller',['$scope',function($scope){ $scope.attempt = function(){ alert('test'); } }]);
Comments
Post a Comment