question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

can't custom UI login component

See original GitHub issue

Issue type

I’m submitting a …

  • [X ] bug report
  • feature request

Issue description

Current behavior: Error: Can’t resolve all parameters for NgxLoginComponent: ([object Object], ?, [object Object], [object Object]).

Expected behavior: I try to extend NgLoginComponent with a constructor inside

Related code:

import {ChangeDetectorRef, Component, Injectable} from '@angular/core';
import {NbAuthService, NbLoginComponent} from '@nebular/auth';
import {AuthService} from '../auth.service';
import {Router} from '@angular/router';


@Component({
  selector: 'app-login',
  templateUrl: './login.component.html',
})

export class NgxLoginComponent extends NbLoginComponent {
  constructor(service: NbAuthService, options: {}, cd: ChangeDetectorRef, routes: Router){
    super(service, options, cd, routes);
  }
}

The issue appear only if I use constructor. I need to use a constructor because I need implement my own auth service in this component.

Other information:

npm, node, OS, Browser

<!--
Node, npm: v11.6.0, 6.5.0-next.0
OS: macOS Mojave (10.14.2)
Browser: Chrome  72.0.3626.96 
-->

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

11reactions
ygggcommented, Feb 14, 2019

Hi @xeti34. You need to use @Inject(NB_AUTH_OPTIONS) protected options as a second parameter of constructor, instead of options: {}. See dependency-injection in angular docs.

0reactions
AvshTcommented, Sep 7, 2020

Hi, Whats works for me its to add the @Option() annotation

@Inject(NB_AUTH_OPTIONS) @Optional() public options

Hope its helps

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I implement a custom UI Login instead of using lock?
Hosting your own login page (form)!. Custom hosted universal login UI. Disable the animation for log in or reset password. Using the Auth0...
Read more >
Cannot create a custom login page with Admin-On-Rest
There is a working example in the admin-on-rest-demo repository: The custom Login component:.
Read more >
Unable to select custom Lightning Community page
So try to add your custom LWC component on that std login page and under Administration settings, select login page type as Community ......
Read more >
Custom UI control not being rendered - Microsoft Q&A
Custom UI control not being rendered. I would like to ask a question what am I doing wrong that my custom control is...
Read more >
UI custom component deploys successfully to instan...
Does anyone know what might be causing us not to get the component fully working 2 in the 3 tested instances? Summary. Successful...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found