zurb / foundation-apps

The first front-end framework created for developing fully responsive web apps.
http://foundation.zurb.com/apps
MIT License
1.58k stars 217 forks source link

ng-click not working in zf-tab #805

Open Silur opened 8 years ago

Silur commented 8 years ago

This was submitted in last year, still not fixed:

<!-- work -->
<a ng-click="test()">test</a>

<!-- doesn't work -->
<div zf-tabs="">
    <div zf-tab="" title="Tab1">
        <a ng-click="test()">test</a>
    </div>
    <div zf-tab="" title="Tab2">
        Tab content 1
    </div>
</div>

$scope.test = function() {
    console.log('test');
}
mattgrande commented 8 years ago

It's ugly as hell, but you basically need to call $parent for every zf-directive you're in, so your new ng-click would be $parent.$parent.test().

(This is from memory; It might only be one $parent)

Silur commented 8 years ago

Thank you :) I came up with this solution too, but if we are using angular, what can handle nested directives then an angular-based framework should be able to handle it too. That's what I mean under "fixed"

soumak77 commented 7 years ago

this issue with be addressed with https://github.com/base-apps/angular-base-apps/issues/24