-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.controllers.inc.js
More file actions
29 lines (24 loc) · 945 Bytes
/
init.controllers.inc.js
File metadata and controls
29 lines (24 loc) · 945 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
angular.module('myApp')
.controller('WidgetController', function($scope,Data){
$scope.parentData = [];
$scope.src = [{"item" : {firstName:"John", lastName:"Doe", age:50, eyeColor:"blue"}}];
$scope.parentData.push($scope.src);
console.log(Data.metadata);
})
.controller( 'FirstCtrl', function ($scope,Data){
$scope.src = [{"item":{firstName:"Adam", lastName:"Biro", age:18, eyeColor:"green"}}];
$scope.data = Data;
$scope.user = $scope.$parent.parentData;
$scope.user.push($scope.src);
Data.metadata =" Overwrited crucial data from child";
console.log(Data.metadata);
})
.controller( 'SecondCtrl', function($scope,Data){
$scope.src = [{"item":{firstName:"Eva", lastName:"Strack", age:90, eyeColor:"grey"}}];
$scope.data = Data;
$scope.user2 = $scope.$parent.parentData;
console.log(Data.metadata);
})
.controller( 'ThirdController', function($scope,Data){
$scope.data = Data;
});