AngularJS | handle routing before they load

Issue I wish to create a simple authentication check for my routes by external service. I define the access requirements on the route object: $routeProvider .when(‘/’, { templateUrl: ‘src/app/views/index.html’, controller: ‘indexCtrl’, authenticated: true }) .when(‘/login’, { templateUrl: ‘src/app/views/login.html’, controller: ‘loginCtrl’,

Continue reading

How to disable submit button until form is valid in angular 12?

Issue login.component.html <form (ngSubmit)="submitLogin()" #loginForm="ngForm"> <div class="form-group"> <label for="exampleInputEmail1">Email address</label> <input type="email" class="form-control" id="email" name="email" [(ngModel)]="form.email" [ngModelOptions]="{standalone: true}" required> </div> <div class="form-group"> <label for="exampleInputPassword1">Password</label> <input type="password" class="form-control" id="password" name="password" [(ngModel)]="form.password" [ngModelOptions]="{standalone: true}" required> </div> <button type="submit" class="btn btn-primary" [disabled]="!loginForm.form.valid">Submit</button> </form>

Continue reading

ES6 imports for JWT

Issue I’m making a nodeJS web app and I’m using JWT for authentication. All my work is in ES6 modules and I wanted to import JWT in the same way, but apparently it isn’t yet supported by the package. I

Continue reading

firebase.auth().currentUser is null

Issue I’m trying to retrieve the UID of the current logged-in firebase user in my Angular 4 app. Though, if I’m logging ‘firebase.auth().currentUser’ to the console I get a ‘null’. So ‘firebase.auth().currentUser.uid’ gives an ‘Cannot read property ‘uid’ of null’

Continue reading

firebase.auth().currentUser is null

Issue I’m trying to retrieve the UID of the current logged-in firebase user in my Angular 4 app. Though, if I’m logging ‘firebase.auth().currentUser’ to the console I get a ‘null’. So ‘firebase.auth().currentUser.uid’ gives an ‘Cannot read property ‘uid’ of null’

Continue reading