eakoriakin / ionic-selectable

Ionic Selectable is an Ionic versatile and highly customizable component that serves as a replacement to Ionic Select, and allows to search items, including async search, create items, customize the layout with templates and much more. It provides an intuitive API and is easy to set up and use.
MIT License
550 stars 123 forks source link

Unable to use ng-templates (ionic 7 / angular 16) #433

Closed woutersteven closed 11 months ago

woutersteven commented 12 months ago

Great job on the plug-in! Many useful features.

Using Ionic 7.3.2 and Angular 16.2.3 and v5 of Ionic-selectable.

aren't working. None of them. The functionality itself, changing language is working fine. If I'm doing something wrong, it's eluding me. ```

Language

Set the interface language

Language (Test)
``` The template for the title, doesn't change the title. Also if i remove the .... there is no title being set. I also wasn't able to update individual item templates (for flag icons). I'm guessing it's the same reason.. Am i missing some property or doing something wrong?
rezendeneto commented 11 months ago

Same here and here's the versions I'm using in my project:

   Ionic Framework               : @ionic/angular 7.3.0
   @angular-devkit/build-angular : 16.2.0
   @angular-devkit/schematics    : 16.2.0
   @angular/cli                  : 16.2.0
   @ionic/angular-toolkit        : 9.0.0
iamrsojitra commented 11 months ago

@rezendeneto @woutersteven2020 You need to import IonicSelectableTitleTemplateDirective directive in your component to work correctly

woutersteven commented 11 months ago

Thank you for your reply. I hadn't realized that, but it does the trick. I'll continue to play with it. Thanks again!

sciu commented 6 months ago

@rezendeneto @woutersteven2020 You need to import IonicSelectableTitleTemplateDirective directive in your component to work correctly

Dear Sir, could you show to me how to import directive in our component. I already try it, but still not working. All ng-template are not working.

Thks.

rezendeneto commented 6 months ago

@sciu have you tried something like this? image

sciu commented 6 months ago

@rezendeneto Thanks for ur help, it works...

I upgrade to ionic-selectable@5.0.3 then

at my page.module.ts :

import { IonicSelectableComponent, IonicSelectableAddItemTemplateDirective } from 'ionic-selectable';

@NgModule({ imports: [ CommonModule, FormsModule, IonicModule, AccountPageRoutingModule, ReactiveFormsModule, IonicSelectableComponent, IonicSelectableAddItemTemplateDirective ], declarations: [AccountPage], })

Hope it would help other.