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.

ngModel' since it isn't a known property of 'ui-switch'

See original GitHub issue

ngModel is not working properly. Issue: compiler.es5.js:1694 Uncaught Error: Template parse errors: Can’t bind to ‘ngModel’ since it isn’t a known property of ‘ui-switch’.

  1. If ‘ui-switch’ is an Angular component and it has ‘ngModel’ input, then verify that it is part of this module.

  2. If ‘ui-switch’ is a Web Component then add ‘CUSTOM_ELEMENTS_SCHEMA’ to the ‘@NgModule.schemas’ of this component to suppress this message.

  3. To allow any property add ‘NO_ERRORS_SCHEMA’ to the ‘@NgModule.schemas’ of this component.

         <ui-switch [ERROR ->][(ngModel)]="enable"></ui-switch>
       </div>
    
<ui-switch [(ngModel)]="enable"></ui-switch>
enable = true;

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
cmckni3commented, Mar 2, 2018

Can’t reproduce on 1.5.0. The demo works fine in the 1.x-stable branch with Angular 4.

Have you imported the module UiSwitchModule?

0reactions
FinlayDaG33kcommented, Nov 21, 2019

Sorry for necro’ing this issue but I want to point out for people coming by here that one can also import it in the shared.module.ts to have it available for all components.

// shared.module.ts
import { UiSwitchModule } from 'ngx-toggle-switch';

@NgModule({
  imports: [UiSwitchModule, ...],
  exports: [UiSwitchModule, ...]
})
export class SharedModule{}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't bind to 'ngModel' since it isn't a known property of 'nz ...
While it doesn't say it in the documentation, you need to have Angular's FormsModule imported in order for the ngModel binding to work....
Read more >
Can't bind to 'ngModel' since it isn't a known property of 'input'
To fix Can't bind to 'ngModel' since it isn't a known property of 'input' error in Angular we have to import FormsModule in...
Read more >
ion-input ngmodel not working, ngmodel ionic 4, can t bind to ...
Can't bind to 'ngModel' since it isn't a known property of 'ui-switch'. If 'ui-switch' is an Angular component and it has 'ngModel' input,...
Read more >
ngx-ui-switch - npm
ngx-ui-switch. TypeScript icon, indicating that this package has built-in type declarations. 14.0.3 • Public • Published 4 months ago.
Read more >
Ng : Ui-Switch Is Not A Known Element In Angular5 - ADocLib
ngx-ui-switch repo issues. be resolved to an NgModule class. ... Can't bind to 'ngModel' since it isn't a known property of 'input'. hide...
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