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

Add default values for ion-view hide-back-button and hide-nav-bar attributes #1216

Closed
wants to merge 1 commit into from
Closed

Add default values for ion-view hide-back-button and hide-nav-bar attributes #1216

wants to merge 1 commit into from

Conversation

jayproulx
Copy link

If your view is missing the hide-back-button or hide-nav-bar attributes, we get exceptions from Angular when trying to watch these non-existent properties.

i.e.

TypeError: Cannot read property 'exp' of undefined
    at ng.config.$provide.decorator.watchFnToHumanReadableString (<anonymous>:703:19)
    at Scope.ng.config.$provide.decorator.$delegate.__proto__.$watch (<anonymous>:735:28)
    at link (http://localhost:3000/bower_components/ionic/release/js/ionic.bundle.js:37265:16)
    at nodeLinkFn (http://localhost:3000/bower_components/ionic/release/js/ionic.bundle.js:13700:13)
    at compositeLinkFn (http://localhost:3000/bower_components/ionic/release/js/ionic.bundle.js:13110:15)
    at publicLinkFn (http://localhost:3000/bower_components/ionic/release/js/ionic.bundle.js:13015:30)
    at updateView (http://localhost:3000/bower_components/ionic/release/js/ionic.bundle.js:37466:11)
    at angular.module.directive.directive.directive.compile.eventHook (http://localhost:3000/bower_components/ionic/release/js/ionic.bundle.js:37410:17)
    at Scope.$get.Scope.$broadcast (http://localhost:3000/bower_components/ionic/release/js/ionic.bundle.js:19731:28)
    at t.transitionTo.t.transition.N.then.t.transition.t.transition (http://localhost:3000/bower_components/angular-ui-router/release/angular-ui-router.min.js:7:10007) <ion-view class="pane">

Fixed by adding default values of false for both attributes (which should stand by undefined == false and that the default behaviour should be to show the nav bar and the back button if possible).

…ributes to prevent exceptions when trying to watch for changes
@ajoslin
Copy link
Contributor

ajoslin commented Apr 29, 2014

I'm not getting this - What version of angular are you using?

Looks like a good fix, though.

EDIT: Ah, those exceptions are from Batarang it looks like.

@ajoslin ajoslin closed this in 12e5f6c Apr 29, 2014
@jayproulx jayproulx deleted the fix-missing-view-attrs branch April 29, 2014 12:46
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

Successfully merging this pull request may close these issues.

3 participants