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

"interface" not initialized when using ng-if #51

Open
zjda opened this issue Mar 2, 2016 · 2 comments
Open

"interface" not initialized when using ng-if #51

zjda opened this issue Mar 2, 2016 · 2 comments

Comments

@zjda
Copy link

zjda commented Mar 2, 2016

When I use ng-if in droplet parent div, the interface is not initialized/setup even though the condition of ng-if is true. The following is my simple test code.

html file:

<div>
    Test ngDroplet interface
    <div ng-if="content">
        <droplet ng-model="interface">inside droplet</droplet>  
    </div>
</div>

js file:

app.controller('testCtrl', ['$scope', function ($scope) {   
    $scope.interface = {};
    $scope.content = true;
    $scope.$on('$dropletReady', function whenDropletReady() {
        console.log($scope.interface);
    });
}]);

Thanks for looking into this.
-ZJ

@zjda
Copy link
Author

zjda commented Mar 2, 2016

Found a workaround: use ng-show instead of ng-if.

@Wildhoney
Copy link
Owner

That's a workaround, but it would be nice to fix the ng-if – will leave the ticket open and investigate 👍

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

No branches or pull requests

2 participants