ngx-bootstrap: Error with new angular RC5

Getting this error when angular app starting

Error: Error: Error: Input 'previousText' defined multiple times in 'PagerComponent'
        at new BaseException (http://localhost:8000/node_modules/@angular/compiler//bundles/compiler.umd.js:5116:27)
        at eval (http://localhost:8000/node_modules/@angular/compiler//bundles/compiler.umd.js:12845:31)
        at Array.forEach (native)
        at DirectiveResolver._merge (http://localhost:8000/node_modules/@angular/compiler//bundles/compiler.umd.js:12842:24)
        at DirectiveResolver._mergeWithPropertyMetadata (http://localhost:8000/node_modules/@angular/compiler//bundles/compiler.umd.js:12834:25)
        at DirectiveResolver.resolve (http://localhost:8000/node_modules/@angular/compiler//bundles/compiler.umd.js:12786:33)
        at CompileMetadataResolver.getDirectiveMetadata (http://localhost:8000/node_modules/@angular/compiler//bundles/compiler.umd.js:13097:55)
        at addDirective (http://localhost:8000/node_modules/@angular/compiler//bundles/compiler.umd.js:13367:37)
        at eval (http://localhost:8000/node_modules/@angular/compiler//bundles/compiler.umd.js:13376:77)
        at Array.forEach (native)
    Evaluating http://localhost:8000/app/main.js
    Error loading http://localhost:8000/app/main.js

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 22
  • Comments: 36 (12 by maintainers)

Most upvoted comments

This is what I get trying to compile my project with RC5:

Unhandled Promise rejection: Template parse errors:
Can't bind to 'templateUrl' since it isn't a known property of 'datepicker-inner'.
1. If 'datepicker-inner' is an Angular component and it has 'templateUrl' input, then verify that it is part of this module.
2. If 'datepicker-inner' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schema' of this component to suppress this message.
 ("ustomClass]="customClass"
                      [dateDisabled]="dateDisabled"
                      [ERROR ->][templateUrl]="templateUrl"
                      [onlyCurrentMonth]="onlyCurrentMonth"
             "): DatePickerComponent@20:22 ; Zone: <root> ; Task: Promise.then ; Value: 

We need @NgModule support to use the directives.

The root cause is that ng2-bootstrap needs to add NgModule support so that it can be added to the imports section of the application module.

However, until that happens, a workaround is to add ng2-bootstrap components and directives to the declarations section of the root application module, and removing the ng2-bootstrap declarations from the application’s Component decorators.

Unfortunately, any attempt to introduce NgModule feature modules to the application will break this workaround.

I’ll give it a shot, thanks!

I can confirm that stopping the mangling of the code with the UglifyPlugin I use in Webpack solves the problem.

@achimha @marcalj Is there already any solution for that problem? Because I suffer the same error as @achimha does:

Error: Uncaught (in promise): Template parse errors:
Can't bind to 'level' since it isn't a known property of 'as-my-battery'.
1. If 'as-my-battery' is an Angular component and it has 'level' input, then verify that it is part of this module.
2. If 'as-my-battery' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schema' of this component to suppress this message.
 (""checkbox" name={{data.name}} value={{data.name}}> {{data.name}}
                    <as-my-battery [ERROR ->][level]='data.battery'></as-my-battery>
                    <as-my-signal [level]='data.signal'></as-"): a@19:35

where as-my-battery has a @Input() level: number; declaration in his class