-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
28 lines (24 loc) · 777 Bytes
/
Copy pathapp.js
File metadata and controls
28 lines (24 loc) · 777 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
var app = angular.module('szalekApp', []);
app
.controller("NameCtrl", function ($scope) {
$scope.hello = "Welcome welcome!";
})
.controller("NameCtrl2", function ($scope) {
$scope.hello = "Welcome welcome! 2";
})
.directive('btbwMenu', function () {
return {
controller: function ($scope, $http) {
$http.get('menu.json').success(function (data) {
$scope.menu = data;
$scope.submenu = data[0].sub;
});
$scope.changeSub = function (menuId) {
$scope.submenu = $scope.menu[menuId].sub;
}
},
restrict: 'E',
templateUrl: 'tpl/menu.tpl.html'
};
});
;