Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Error on Searchbar Cancel

$
0
0

@drachenbach1 wrote:

Hi guys,
I'm using Ionic 2.0.0-beta.19. I want to make use of the Searchbar component and react to it's cancel() function. I've read the docs and implemented it like this:
.ts

    import ...

        @Page({
            templateUrl: 'build/pages/feed/feed.html',
            directives: [ItemComponent]
        })
        export class FeedPage {
            constructor(private nav: NavController, private itemService: ItemService) {
                this.searchbarVisible = false;
                this.searchQuery = "";
            }

            private searchbarVisible: boolean;
            searchQuery: string;
            private items: Item[];

            openSearch() {
                this.searchbarVisible = !this.searchbarVisible;
            }

            search(searchbar) {
            }

            searchbarCancelled(searchbar) {
                this.searchbarVisible = !this.searchbarVisible;
                debugger;
            }
        }

html

<ion-searchbar *ngIf="searchbarVisible" [(ngModel)]="searchQuery" (input)="search($event)" (cancel)="searchbarCancelled($event)"></ion-searchbar>

Now when I cancel my Searchbar it throws several errors:

Error: Attempt to use a dehydrated detector: Page_3 -> blu

Same also for clear, ngModelChange, clear and input.

Any idea what is wrong?

thanks,
drachenbach

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>