Skip to content
This repository was archived by the owner on Dec 1, 2023. It is now read-only.

Conversation

@francisl
Copy link

@francisl francisl commented Aug 1, 2013

I had the possibilities the specified a bootstrap icon in the javascript object. Instead of concatenate it to the text.

e.g.

$scope.dropdown: [
{
"text": "Another action",
"href": "#anotherAction"
"icon": "icon-check"
}]

mgcrea added a commit that referenced this pull request Aug 6, 2013
feat(modal): added possibilities to have icons in dropdown list
@mgcrea mgcrea merged commit 3bb4f51 into mgcrea:master Aug 6, 2013
@mgcrea
Copy link
Owner

mgcrea commented Aug 6, 2013

Great, thanks!

@jperelli
Copy link

Is this working on angular-strap for bootstrap3?

@francisl
Copy link
Author

Yes, with the angular-strap 2.0.0 rewrite.

Now you need to flag the data as html, and set the icon in your controller.

Note that this way of doing thing has the bad side effect of breaking automatic translation and filters.

<button type="button" bs-dropdown="dropdown" data-html="true">

In controller:

text = '<i class=\"' + icons[elem] + '\">' + "</i> " + translatedText

@jperelli
Copy link

Thanks it works perfectly!
I didn't find that in the docs.
Just one thing to note is that angular-sanitize.js is needed (and the corresponding ngSanitize injected)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants