Skip to content

Instantly share code, notes, and snippets.

@Songbird0
Created December 7, 2017 22:33
Show Gist options
  • Save Songbird0/b53b00403356fbd8ad49d8429a3f96c7 to your computer and use it in GitHub Desktop.
Save Songbird0/b53b00403356fbd8ad49d8429a3f96c7 to your computer and use it in GitHub Desktop.
Dirty draft
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<body ng-app="Foo" ng-controller="Controller">
<tree-generator tree-title="pwet" sections="['bar', 'baz', 'bang']"></tree-generator>
<script>
angular.module('Foo', [])
.controller('Controller', ['$scope', function($scope) {
$scope.treeTitle = "foo";
$scope.sections = [];
}])
.directive('treeGenerator', function() {
return {
restrict: 'E',
scope: {
treeTitle: '@',
sections: '=',
},
template: '<h1>title: {{ treeTitle }}, sections: {{ sections }}</h1>'
};
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment