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 nav-bar type attribute to accept either a string or AngularJS expression #599

Closed
jough opened this issue Feb 13, 2014 · 5 comments
Closed

Comments

@jough
Copy link

jough commented Feb 13, 2014

Right now nav-bar type="class name strings" only accept class strings, but if it accepted an Angular expression or a string we'd be able to change the classes on the nav-bar (and I suppose header-bar) by setting a $scope variable.

As discussed here:

http://forum.ionicframework.com/t/chaning-nav-bar-classes-on-page-loads/784/8

@jough
Copy link
Author

jough commented Feb 13, 2014

I'll note that accepting a string will keep backwards compatibility. There are numerous AngularJS built-in directives that do this, so it would be keeping with the spirit of Angular as well.

@ajoslin
Copy link
Contributor

ajoslin commented Feb 13, 2014

Thanks @jough! added :-)

@dmackerman
Copy link

This doesn't seem to work? I'm binding a class name to $rootScope, and then using it like so:

$rootScope.headerClass = 'bar-positive';
<ion-nav-bar type="{{headerClass}}" class="nav-title-slide-ios7">

HTML output: (no class added)
cool

@greemwahr
Copy link

Will this work for all attributes in ionic, like view-title attribute in <ion-view>?

@adamduren
Copy link
Contributor

@jough It looks like the type attribute was removed in place of using classes. I tried using ng-class but it doesn't seem to carry the class over to the ion-header-bar. Is there a new supported way to do this?

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants