Using AngularJs, I am developing a unique single web application that includes two important buttons: login and sign up. Each time a button is clicked, a directive appears from the top of the page, created using CSS.
Below is an example of the login directive code:
app.directive('loginDirective', function () {
return {
restrict: 'EA',
templateUrl: 'app/directives/loginDirective.html',
}
});
Initially, the popup functions correctly as intended.
enter image description here
However, when adding the controller loginCtrl, the popup stops working. Here is the modified code:
app.directive('loginDirective', function () {
return {
restrict: 'EA', //E = element, A = attribute, C = class, M = comment
templateUrl: 'app/directives/loginDirective.html',
controller: 'loginCtrl'
}});
I'm unsure why this issue is occurring. Could there be a conflict with the CSS?
var app = angular.module('cbApp', ['ngStorage','ngRoute']);
app.controller("loginCtrl",['$scope', '$location', '$localStorage', 'Auth', function( $scope, $location, $localStorage, Auth){}
Remarkably, removing the $location resolves the problem...