Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default modal template? #91

Closed
boubou158 opened this issue Apr 1, 2017 · 3 comments
Closed

Change default modal template? #91

boubou158 opened this issue Apr 1, 2017 · 3 comments

Comments

@boubou158
Copy link

Hi,

Is it possible to change the default modal template? I need to change the class of the reset button in the html code but I don't know how to do, there is no options for that.

Thanks a lot and great work by the way ;)

Rémi

@aless673
Copy link

aless673 commented Apr 6, 2017

Hi,

You can use the option "search-template" :

<button id="modalButton" modal-select
    options="contacts"
    ng-model="selectedContacts"
    on-select="onChange(newValue, oldValue)"
    search-template="templates/modal-template.html">

Copy/paste the "modal-template.html" (or modal-template-multiple.html) in your template folder.
Now you have to load the template in the $templateCache, here's how :

$http.get('templates/modal-template.html').then(function (response) {
    $templateCache.put('templates/modal-template.html', response.data);
});

Be careful, the "templates/modal-template.html" is not related with the real path (except for the $http call), this is only a key to retrieve the cached template.

@bianchimro
Copy link
Member

@aless673 thanks for your clarification.

Do you think we need a "search-template-url" option in order to get a template from a path?
That would reduce the boilerplate of putting the template into the cache.

I am closing this anyway, if you feel so open a new issue about this.

regards
Mauro

@aless673
Copy link

aless673 commented Apr 6, 2017

@bianchimro Yes of course we need this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants