djett41 / ionic-filter-bar

Filter Bar plugin for the Ionic Framework
MIT License
362 stars 112 forks source link

Choose placeholder text in service options and not only in config #68

Open MatanYadaev opened 8 years ago

MatanYadaev commented 8 years ago

I am using angular-translate, my Ionic app can change languages while running. I need to change placeholder text dynamically. Cancel text I can change without problem in service options, please add placeholder too...

donaldinou commented 8 years ago

100% agreed

If you need a temporary "fix". I've done it like this:

$ionicFilterBar.show({
    items: $scope.items,

    // The fix is here
    done: function() {
        var input = document.querySelector("ion-filter-bar input.filter-bar-search");
            if (input) {
                angular.element(input).attr("placeholder", "my i18n search placeholder");
            }
    },
    //

    update: function(filteredItems, filterText) {
        // do some things
    },
    expression: function (filterText, value, index, array) {
        // do some things
    },
    cancelText: "my i18n cancel text"
});
yanmagale commented 8 years ago

@donaldinou it works!