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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
angular.module("template/modalsAndAlerts/window2.html", []).run(["$templateCache", function($templateCache) {
$templateCache.put("template/modalsAndAlerts/window.html",
"<div class=\"modalwrapper active {{windowClass}}\" ng-class=\"{'modal-landscape': isModalLandscape}\" role=\"dialog\" tabindex=\"-1\" aria-labelledby=\"{{title}}\" aria-describedby=\"{{content}}\">\n" +
" <div class=\"modal fade {{sizeClass}}\">sdfdsfsfd</div>\n" +
"</div>");
}]);
angular.module('ddh.att.modalsAndAlerts')
.controller('modalsAndAlertsController', function ($scope, $modal, $log) {
$scope.name='eeee';
$scope.items = ['item1', 'item2', 'item3'];
$scope.dt = new Date("March 10, 2014 00:00:00");
$scope.helperText = "The date you selected is $date. Double tap to open calendar. Select a date to close the calendar.";
$scope.open = function (event) {
var modalInstance = $modal.open({
templateUrl: 'template/modalsAndAlerts/modal-demo.html',
controller: ModalInstanceCtrl,
sizeClass: 'modal-long-adjust',
resolve: {
items: function () {
return $scope.items;
}
}
});
modalInstance.result.then(function (selectedItem) {
$scope.selected = selectedItem;
event.target.focus();
}, function () {
$log.info('Modal dismissed at: ' + new Date());
event.target.focus();
});
};
$scope.ok = function () {
//add the ok functionality
console.log("ok");
};
$scope.cancel = function () {
//add the cancel functionality
console.log("cancel");
};
})
var ModalInstanceCtrl = function ($scope, $modalInstance, items) {
$scope.items = items;
$scope.selected = {
item: $scope.items[0]
};
$scope.ok = function () {
$modalInstance.close($scope.selected.item);
};
$scope.cancel = function () {
$modalInstance.dismiss('cancel');
};
};
|