-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdialog2.js
40 lines (38 loc) · 1.17 KB
/
dialog2.js
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
define('dialog2',['utils'],function(utils){
var bindD2 = function(dialogOptions) {
$('#'+ dialogOptions.elementId).click(function(){
var dialogElement;
dialogElement = '<div id="'+ dialogOptions.dialogId + '" title="'+ dialogOptions.titel +'" ng-controller="'+dialogOptions.controllerName+'">';
dialogElement += 'Andra dialogens titel är: ';
dialogElement += '<span ng-bind="'+dialogOptions.modell+'"></span>';
dialogElement += '<input ng-model="new_name"/>';
dialogElement += '</div>';
$(dialogElement).dialog({
create: function(){
if(!utils.isModuleLoaded(dialogOptions.moduleName)) {
angular.module(dialogOptions.moduleName, [])
.controller(dialogOptions.controllerName, function($scope){
$scope.title = dialogOptions.dialogText;
})
.directive('testDialog',function(){
return {
scope: {
},
template: '',
link: function(scope,element,attrs){
}
}
})
angular.bootstrap('#'+dialogOptions.dialogId,[dialogOptions.moduleName])
}
}
});
});
};
return {
initiera: bindD2
}
});
$(function(){
//Here is were we used to declare the click event.
});