I am learning Angular JS
Here is my app.js
.when('/forget', {
title: 'forget',
templateUrl: 'resources/views/forget.php',
controller: 'genCtrl'
})
.otherwise({
redirectTo: '/login'
});
I want to display the forget.php
file inside resources/views
folder
Here is my genCtrl
app.controller('genCtrl', function ($scope, $rootScope, $routeParams, $location, $http, Data) {
//initially set those objects to null to avoid undefined error
$scope.forget = function ()
{
return 1;
}
});
When ever i do http://localhost/myapp/#/forget
the browser is displaying the content of forget.php
and then suddenly taking me to /login
.
How can i remain in the same page ?
Update :
Here is my app.js
Here is my genCtrl.js
Here is the console