Skip to content

Instantly share code, notes, and snippets.

@hunterloftis
Created June 18, 2013 19:45
Show Gist options
  • Save hunterloftis/5808628 to your computer and use it in GitHub Desktop.
Save hunterloftis/5808628 to your computer and use it in GitHub Desktop.
<html ng-app='testApp'>
<body ng-controller='testController'>
<button ng-click='test()'>Menu</button>
<my-custom-directive id='needToAccess'></my-custom-directive>
</body>
<script>
angular
.module('testApp', [])
.controller('testController', function($scope) {
$scope.test = function() {
// myCustomDirective has an "open" method on its scope.
// I can put this method on its controller if that would be better.
// In any case, I need to trigger this method inside of test() but I don't know how. Something like this?
(some way of identifying #needToAccess).open();
};
});
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment