Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Tabset direction, parent scope #849

Closed
martijndwars opened this issue Aug 19, 2013 · 4 comments
Closed

Tabset direction, parent scope #849

martijndwars opened this issue Aug 19, 2013 · 4 comments

Comments

@martijndwars
Copy link

Hi,

The tabset compile function contains the following code:

    scope.vertical = angular.isDefined(attrs.vertical) ? scope.$eval(attrs.vertical) : false;
    scope.type = angular.isDefined(attrs.type) ? scope.$parent.$eval(attrs.type) : 'tabs';
    scope.direction = angular.isDefined(attrs.direction) ? scope.$parent.$eval(attrs.direction) : 'top';

I'm not very familiar with angular, but I really don't understand why the type and direction are evaluated in the parent scope. Being dependent on the parent scope seems to me like a very bad practice. Also, I see absolutely no reason not to define these properties as attributes on tabset, such as the case with vertical.

Is this a bug?

@bekos
Copy link
Contributor

bekos commented Aug 19, 2013

@martijndwars All these attributes are defined as tabset attributes. You can see the demo page for an example how to do it. About the evaluation, there is bug, but that's the vertical not evaluated against parent scope :)

This directive creates an isolated scope, so parent scope is your scope, where you define the tabset attributes.

@davidwparker
Copy link

@bekos Where on the demo page (http://angular-ui.github.io/bootstrap/) does it show an example of direction? I'm pretty sure that the docs are out of date with the current version of UI... in fact, I thought the direction was set up before, but when I looked at UI's changelog (https://github.com/angular-ui/bootstrap/blob/master/CHANGELOG.md) I saw that I needed to upgrade.

Do we think it would be possible to show versions of the docs (like Twitter Bootstrap is doing) so we know which version has what available as far as the API is concerned?

@hallister
Copy link

@davidwparker In the demos the last tabset example is:

<tabset vertical="true" type="navType">
    <tab heading="Vertical 1">Vertical content 1</tab>
    <tab heading="Vertical 2">Vertical content 2</tab>
</tabset>

As far as the versions of the docs, I'll let one of the core guys chime in on that, but IMHO, versioning docs makes sense when you have significant version changes on a relatively stable project. However, this project has had 5 releases in 7 months, and the last 2 introduced breaking changes. In the future we are going to see some big breaking changes with Bootstrap 3 and Angular 1.2 being released, that each individually introduce major breaking changes.

I think once this project stabilizes, your idea is a good one. But for now that's going to add a lot of work that should be invested into the project itself :).

@davidwparker
Copy link

Yeah, I saw the vertical = 'true' but there wasn't any mention of direction='right' or anything like that, thus my confusion.

I think if there's going to be a lot of changes (which I foresee, given what you said), then maybe a big warning at tho top of the documentation about the changes that are taking place and a link to the CHANGELOG would suffice.

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

Successfully merging a pull request may close this issue.

4 participants