title: i am trying to create a simple login app with angularjs using routing but event is not handled
body: <p>i am trying to create login app using only angularjs,i have used routing of angularjs initially div in which "ng-view" is defined routes to login page .but after entering the username and password when i click button nothing happens i.e event is not handled..
  below is code for index page:</p>
  
  <pre><code> &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Login App&lt;/title&gt;
      &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"&gt;&lt;/script&gt;
      &lt;script src="angular-route.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body ng-app="mylogin"&gt;
  &lt;h1&gt;Login Page&lt;/h1&gt;
  &lt;div ng-view&gt;&lt;/div&gt;
  &lt;script&gt;
      var app=angular.module('mylogin',['ngRoute']);
      app.config(function($routeProvider){
          $routeProvider
          .when('/',{
              templateUrl:"login.html"
          })
          .when('/dashboard',{
              templateUrl:"dashboard.html"
          })
          .otherwise({
              redirectTo:"/"
          });
      });
  
  app.controller("loginctrl",function($scope,$location)
          {
              $scope.submit=function()
              {
                  var uname=$scope.username;
                  var pwd=$scope.password;
                  if($scope.username=='admin' &amp;&amp; $scope.password=='admin')
                  {
                      $location.path('/dashboard');
                  }
              };
          });
  
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>below is code for login page:</p>
  
  <pre><code>    &lt;div ng-controller="loginctrl"&gt;
  &lt;form action="/" id="mylogin"&gt;
  Username:&lt;input type="text" id="username" ng-model="username"&gt;&lt;br&gt;
  Password:&lt;input type="password" id="password" ng-model="pasword"&gt;&lt;br&gt;
  &lt;button type="button" ng-click="submit()"&gt;Login&lt;/button&gt;    
  &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>