Angular: Empty Fiddle

http://angularjs.org/

by martijngr

HTML

<script src="http://code.angularjs.org/angular-1.0.1.js"></script>
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.0/css/bootstrap-combined.min.css">
<div ng-controller="MyCtrl">
    <button ng-click="openCustomer()">Open Customer</button>
    <button ng-click="openForm()">Open Form</button>
    
    <my-Directive>    
    </my-Directive>

    <script type="text/ng-template" id="/temp1" >
        <div>hoi!!</div>
    </script>

</div>

JavaScript

var myApp = angular.module('myApp',[]);

myApp.directive('myDirective', function() {
    return {
        restrict: 'E',
        templateUrl: '/temp1',
        link: function(scope, elemen, attrs){
            debugger;
        }
    }
});

function MyCtrl($scope) {
    $scope.name = 'Superhero';
    $scope.displayAccordion = false;
    $scope.visible = true;
    
    $scope.openCustomer = function(){
        //$scope.displayAccordion = true;    
        $("#collapseOne").collapse("show");
    };
    
    $scope.openForm = function(){
        console.log('opn form click');
        $scope.visible = true;
    };
}