Created
December 7, 2017 22:33
-
-
Save Songbird0/b53b00403356fbd8ad49d8429a3f96c7 to your computer and use it in GitHub Desktop.
Dirty draft
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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