ng2-semantic-ui: this._renderer.removeClass is not a function when using select in certain templates

I’m using

  • ng2-semantic-ui 0.8.2
  • angular-cli 1.1.1
  • angular 4.1.3

when trying to do a Search Selection as the docs,

this works


<!-- i'm including a template that i don't use -->
<ng-template let-option #clienteTemplate>
    {{ option.name }}
</ng-template>

<sui-select [(ngModel)]="selectedOption" [options]="options" labelField="name" [isSearchable]="true" #select>
	<sui-select-option *ngFor="let option of select.availableOptions" [value]="option"></sui-select-option>
</sui-select>

this DOESN’T

<!-- i'm only commenting a template that I DO NOT USE
ng-template let-option #clienteTemplate>
    {{ option.name }}
</ng-template 
-->

<sui-select [(ngModel)]="selectedOption" [options]="options" labelField="name" [isSearchable]="true" #select>
	<sui-select-option *ngFor="let option of select.availableOptions" [value]="option"></sui-select-option>
</sui-select>

there is an error, saying:

ERROR Error: Uncaught (in promise): TypeError: this._renderer.removeClass is not a function
TypeError: this._renderer.removeClass is not a function
    at SuiDropdownMenuItem.set [as isSelected] (dropdown-menu.js:58)
    at new SuiDropdownMenuItem (dropdown-menu.js:26)
    at createClass (core.es5.js:10895)
    at createDirectiveInstance (core.es5.js:10723)
    at createViewNodes (core.es5.js:12086)
    at callViewAction (core.es5.js:12530)
    at execComponentViewsAction (core.es5.js:12439)
    at createViewNodes (core.es5.js:12113)
    at createRootView (core.es5.js:11991)
    at callWithDebugContext (core.es5.js:13206)
    at SuiDropdownMenuItem.set [as isSelected] (dropdown-menu.js:58)
    at new SuiDropdownMenuItem (dropdown-menu.js:26)
    at createClass (core.es5.js:10895)
    at createDirectiveInstance (core.es5.js:10723)
    at createViewNodes (core.es5.js:12086)
    at callViewAction (core.es5.js:12530)
    at execComponentViewsAction (core.es5.js:12439)
    at createViewNodes (core.es5.js:12113)
    at createRootView (core.es5.js:11991)
    at callWithDebugContext (core.es5.js:13206)
    at resolvePromise (zone.js:770)
    at resolvePromise (zone.js:741)
    at zone.js:818
    at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:424)
    at Object.onInvokeTask (core.es5.js:4140)
    at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
    at Zone.webpackJsonp.../../../../zone.js/dist/zone.js.Zone.runTask (zone.js:191)
    at drainMicroTaskQueue (zone.js:584)
    at <anonymous>

I can make a demo project (actually, I’m already doing it… ), but it seems like a patch kind of an issue.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 19 (11 by maintainers)

Commits related to this issue

Most upvoted comments

Good call about a note - will rename this issue rather than add the note in the docs as it doesn’t seem to be happening very often.

I can’t seem to reproduce this using the demo app - could you please make a plunkr from this template that exhibits the issue?