Skip to content

Instantly share code, notes, and snippets.

@jcheype
Created June 18, 2013 15:33
Show Gist options
  • Select an option

  • Save jcheype/5806384 to your computer and use it in GitHub Desktop.

Select an option

Save jcheype/5806384 to your computer and use it in GitHub Desktop.
angular.module('Plite', []).directive('panel', () ->
{
restrict: 'E',
replace: true,
transclude:true,
templateUrl: 'partials/main/panel',
scope: true,
controller : [
'$scope', '$element', '$attrs',
($scope, $element, $attrs) ->
$scope.show = $attrs.show == "true"
$scope.title = $attrs.title
$scope.toggle = -> $scope.show=!$scope.show
]
}
).directive('subpanel', () ->
{
restrict: 'E',
replace: true,
transclude:true,
templateUrl: 'partials/main/subpanel',
scope: true,
controller : [
'$scope', '$element', '$attrs',
($scope, $element, $attrs) ->
$scope.show = $attrs.show == "true"
$scope.title = $attrs.title
$scope.toggle = -> $scope.show=!$scope.show
]
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment