UncommonConcept / ngx-toggle-switch

AoT build issue fix, Will be more collaborative repository. Since no activity of angular2-ui-switch repository.
MIT License
16 stars 8 forks source link

Toggle text can't be edited ? #2

Closed djtahl closed 6 years ago

djtahl commented 7 years ago

Hello, I'm using Angular 4.0.0, and when I use : <ui-switch labelOn="On" labelOff="Off"></ui-switch>, the labels keep displaying "Yes"/"No" instead of "On"/"Off".

Is this and issue with the ui-switch package ?

jueewo commented 6 years ago

Hello, here a quick-fix: In the file ui-switch.component.ts change lines 26:29 to these lines:

  <span class="switch-text" *ngIf="!!labelOn || !!labelOff">
    <span class="on">{{labelOn || 'Yes'}}</span>
    <span class="off">{{labelOff || 'No'}}</span>
  </span>
erenalbayrak commented 6 years ago

After this hotfix I can't compile now "ERROR in UiSwitchModule is not an NgModule"

erenalbayrak commented 6 years ago

This work now: import {UiSwitchModule} from 'ngx-toggle-switch/src'; This not: import {UiSwitchModule} from 'ngx-toggle-switch';

sureshbakshi commented 6 years ago

after this fix also .it is not showing custom label text.

codinronan commented 6 years ago

Hi there, I have addressed this via #5

I have also brought this repo up to date with the upstream repo, so it brings in all the AOT, NG5, bugfix goodies. Please note, the new version builds on Angular 5, hopefully you can update.

By the way the new version is now also published to NPM: https://www.npmjs.com/package/ngx-toggle-switch