ngx-bootstrap: Typings error after updating ng2-b and angular

[default] project/node_modules/ng2-bootstrap/components/buttons/button-checkbox.directive.d.ts:14:13 Duplicate identifier 'readonly'. [default] project/node_modules/ng2-bootstrap/components/buttons/button-checkbox.directive.d.ts:14:22 '=' expected. [default] project/node_modules/ng2-bootstrap/components/buttons/button-checkbox.directive.d.ts:14:22 Cannot find name 'trueValue'. [default] project/node_modules/ng2-bootstrap/components/buttons/button-checkbox.directive.d.ts:15:13 Duplicate identifier 'readonly'. [default] project/node_modules/ng2-bootstrap/components/buttons/button-checkbox.directive.d.ts:15:22 '=' expected. [default] project/node_modules/ng2-bootstrap/components/buttons/button-checkbox.directive.d.ts:15:22 Cannot find name 'falseValue'. [default] project/node_modules/ng2-bootstrap/components/buttons/button-radio.directive.d.ts:10:14 '=' expected. [default] project/node_modules/ng2-bootstrap/components/buttons/button-radio.directive.d.ts:10:14 Cannot find name 'isActive'. [default] project/node_modules/ng2-bootstrap/components/buttons/button-radio.directive.d.ts:10:22 ';' expected. [default] project/node_modules/ng2-bootstrap/components/dropdown/dropdown-toggle.directive.d.ts:11:14 '=' expected. [default] project/node_modules/ng2-bootstrap/components/dropdown/dropdown-toggle.directive.d.ts:11:14 Cannot find name 'isOpen'. [default] project/node_modules/ng2-bootstrap/components/dropdown/dropdown-toggle.directive.d.ts:11:20 ';' expected. [default] project/node_modules/ng2-bootstrap/components/modal/modal.component.d.ts:15:5 Duplicate identifier 'readonly'. [default] project/node_modules/ng2-bootstrap/components/modal/modal.component.d.ts:15:14 '=' expected. [default] project/node_modules/ng2-bootstrap/components/modal/modal.component.d.ts:15:14 Cannot find name 'isShown'. [default] project/node_modules/ng2-bootstrap/components/modal/modal.component.d.ts:15:21 ';' expected. [default] project/node_modules/ng2-bootstrap/components/modal/modal.component.d.ts:23:13 Duplicate identifier 'readonly'. [default] project/node_modules/ng2-bootstrap/components/modal/modal.component.d.ts:23:22 '=' expected. [default] project/node_modules/ng2-bootstrap/components/position.d.ts:29:13 Duplicate identifier 'readonly'. [default] project/node_modules/ng2-bootstrap/components/position.d.ts:29:22 '=' expected. [default] project/node_modules/ng2-bootstrap/components/position.d.ts:30:13 Duplicate identifier 'readonly'. [default] project/node_modules/ng2-bootstrap/components/position.d.ts:30:22 '=' expected. [default] project/node_modules/ng2-bootstrap/components/tooltip/tooltip-container.component.d.ts:21:14 '=' expected. [default] project/node_modules/ng2-bootstrap/components/tooltip/tooltip-container.component.d.ts:21:14 Cannot find name 'isTemplate'. [default] project/node_modules/ng2-bootstrap/components/tooltip/tooltip-container.component.d.ts:21:24 ';' expected. [default] project/node_modules/ng2-bootstrap/components/typeahead/typeahead-container.component.d.ts:18:14 '=' expected. [default] project/node_modules/ng2-bootstrap/components/typeahead/typeahead-container.component.d.ts:18:14 Cannot find name 'itemTemplate'. [default] project/node_modules/ng2-bootstrap/components/typeahead/typeahead-container.component.d.ts:18:26 ';' expected. [default] project/node_modules/ng2-bootstrap/components/typeahead/typeahead-container.component.d.ts:18:40 Type parameter name cannot be 'any' [default] project/node_modules/ng2-bootstrap/components/typeahead/typeahead-container.component.d.ts:18:44 '(' expected. [default] project/node_modules/ng2-bootstrap/components/typeahead/typeahead.directive.d.ts:46:14 '=' expected. [default] project/node_modules/ng2-bootstrap/components/typeahead/typeahead.directive.d.ts:46:14 Cannot find name 'matches'. [default] project/node_modules/ng2-bootstrap/components/typeahead/typeahead.directive.d.ts:46:21 ';' expected. [default] project/node_modules/ng2-bootstrap/components/typeahead/typeahead.directive.d.ts:46:29 Type parameter name cannot be 'any' [default] project/node_modules/ng2-bootstrap/components/typeahead/typeahead.directive.d.ts:46:33 '(' expected.

This appeared after updating to angular 2.0.0 and ng2-bootstrap to 1.1.4, is this supposed to work?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 1
  • Comments: 26 (6 by maintainers)

Most upvoted comments

Confirmed. Upgrading version of typescript package to “^2.0.0” in package.json does the trick.

Same here with webpack and RC6 and ng2-bootstrap 1.1.4



(29,22): error TS1005: '=' expected.                                                                                                                                                      
(30,22): error TS1005: '=' expected. 

+1

@Avien What’s wrong with TypeScript 2 ? Angular project itself already uses it… The only option is to use an older version of ng2-bootstrap, from before it was upgraded to TypeScript 2.

@adrianfaciu thanks for helping guys in solving issues! 😃

For WebStorm you should be able to change it from Settings => Language & Frameworks => Typescript and you should have a check to use a custom version, where you need to specify the install folder (so yes, might be a good idea to install it globally).

For Visual Studio you need to install the beta version of the plugin. Have a look in the post announcing Typescript 2.0 (or install it globally with npm, it might pick it up right away).

@jackyphuong It uses an older version of typescript. You have to explicitly tell it to use something else. When you create the project, in the task:

 var project = ts.createProject('tsconfig.json',  {
    typescript: require('typescript')
});

That will make it use whatever version you have installed.

Yeap, I have to update ng2-bootstrap to typescript 2 because angular2 is using ts 2 too already