-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexample_include.js
More file actions
41 lines (32 loc) · 1005 Bytes
/
example_include.js
File metadata and controls
41 lines (32 loc) · 1005 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
* Created by nibo on 2016-01-15.
*/
var exampleApp = angular.module("exampleApp");
var exampleIncludeController = function ($scope) {
$scope.showMoreInfo = false;
$scope.moreInfoCaption = "show more";
$scope.testController = function (message) {
window.alert(message);
};
$scope.toggleMoreInfo = function() {
$scope.showMoreInfo = !$scope.showMoreInfo;
if ($scope.showMoreInfo) {
$scope.moreInfoCaption = "show less"
}
else {
$scope.moreInfoCaption = "show more"
}
}
};
exampleApp.directive('exampleIncludeDirective', function () {
return {
require: [],
restrict: 'A',
scope: false,
// Define a controller, use the function from above, inject the scope
controller: ['$scope', exampleIncludeController],
link: function (scope, iElement, iAttrs, ngModelCtrl) {
console.log("In example directive link function");
}
};
});