forked from DevExpress/obsolete-devextreme-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
57 lines (50 loc) · 1.67 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<title>DevExtreme with RequireJS and AngularJS example</title>
<link rel="stylesheet" type="text/css" href="node_modules/devextreme/dist/css/dx.common.css" />
<link rel="stylesheet" type="text/css" href="node_modules/devextreme/dist/css/dx.light.css" />
<script src="node_modules/requirejs/require.js"></script>
</head>
<body>
<div ng-controller="myController">
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%)">
<div dx-button="buttonOptions"></div>
</div>
</div>
<script>
require.config({
paths: {
"jquery": "node_modules/jquery/dist/jquery",
"angular": "node_modules/angular/angular",
"angular-sanitize": "node_modules/angular-sanitize/angular-sanitize",
"devextreme": "node_modules/devextreme"
},
shim: {
"angular": {
deps: ["jquery"],
exports: 'angular'
},
"angular-sanitize": {
deps: ["angular"]
},
"devextreme/integration/angular": {
deps: ['angular', 'angular-sanitize']
}
}
});
require(["angular", "devextreme/ui/dialog", "devextreme/integration/angular", "devextreme/ui/button"], function(angular, dialog) {
var myApp = angular.module('myApp', ['dx']);
myApp.controller("myController", function($scope) {
$scope.buttonOptions = {
text: "Say 'Hello world'",
onClick: function() {
dialog.alert('Hello world!', '', false);
}
};
});
angular.bootstrap(document, ['myApp']);
});
</script>
</body>
</html>