Skip to content

Commit 4aef72a

Browse files
committed
improve directory structure and lite-server/testing config
1 parent 5de0796 commit 4aef72a

File tree

7 files changed

+39
-26
lines changed

7 files changed

+39
-26
lines changed

.bowerrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"directory": "./app/bower_components"
2+
"directory": "./bower_components"
33
}

app/attribute.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<div>
2-
<h2>points</h2>
2+
<h2>Points!</h2>
33
<p>Index sum: {{pointsModel.getIndexSum()}}
44
<ul>
55
<li *ngFor="let point of points.toArray()">
6-
<span>{{point.attributes.index}} ({{point.geometry.x}},{{point.geometry.y}})</span>
6+
<span>{{point.attributes.index}} ({{point.geometry.x | number:6}},{{point.geometry.y | number:6}})</span>
77
</li>
88
</ul>
99
</div>

app/points.model.spec.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { PointsModel } from './points.model';
33
describe('PointsModel tests', function() {
44
var mockPoint = {
55
attributes: {
6-
index: 0
6+
index: 1
77
},
88
geometry: {
99
x: 1,
@@ -43,5 +43,13 @@ describe('PointsModel tests', function() {
4343
expect(pointsModel.getPointGraphics().length).toEqual(0);
4444
});
4545
});
46+
47+
describe('calculations', function() {
48+
it('should calculate the sum of the index attributes', function() {
49+
pointsModel.addPoints([mockPoint, mockPoint]);
50+
var sum = pointsModel.getIndexSum();
51+
expect(sum).toEqual(2);
52+
});
53+
});
4654

4755
});

bower.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jsapi4angular2",
3-
"description": "",
3+
"description": "Testing angular 2 with esri jsapi 4",
44
"main": "",
55
"authors": [
66
"Josh Werts <joshwerts@gmail.com>"
@@ -17,6 +17,10 @@
1717
"tests"
1818
],
1919
"dependencies": {
20-
"esri": "arcgis-js-api#4.0.0"
20+
"esri": "arcgis-js-api#4.0.0",
21+
"bootstrap": "^3.3.6"
22+
},
23+
"resolutions": {
24+
"dojo": "v1.10.4/esri-3.14.0"
2125
}
2226
}

bs-config.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"port": 3000,
3+
"files": ["./**/*.{html,htm,css,js}"],
4+
"server": { "baseDir": "./" },
5+
"watchOptions": {
6+
"ignored": [
7+
"node_modules",
8+
"bower_components",
9+
"_test-output",
10+
"*.spec.*"
11+
]
12+
}
13+
}

css/main.css

Lines changed: 0 additions & 14 deletions
This file was deleted.

index.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<html>
22
<head>
33
<title>jsapi4/angular2</title>
4-
<link rel="stylesheet" href="https://js.arcgis.com/4.0/esri/css/main.css">
5-
<link rel="stylesheet" href="./app/styles/main.css">
4+
<link rel="stylesheet" href="bower_components/esri/css/main.css">
5+
<link rel="stylesheet" href="bower_components/esri/calcite/calcite.css"/>
6+
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css"/>
7+
<link rel="stylesheet" href="app/styles/main.css">
68

79
<!-- 1. Load libraries -->
810
<script src="node_modules/angular2/bundles/angular2-polyfills.js"></script>
@@ -11,8 +13,8 @@
1113
<script src="node_modules/angular2/bundles/angular2.dev.js"></script>
1214

1315
<!-- 2. Configure SystemJS -->
14-
<script src="./app/bower_components/dojo/dojo.js"></script>
15-
<script src="./app/dojoConfig.js"></script>
16+
<script src="bower_components/dojo/dojo.js"></script>
17+
<script src="app/dojoConfig.js"></script>
1618
<script src="node_modules/esri-system-js/dist/esriSystem.js"></script>
1719
<script src="systemjs.config.js"></script>
1820
</head>
@@ -22,8 +24,8 @@
2224
<div class="container-fluid">
2325
<my-app>Loading...</my-app>
2426
</div>
25-
<script src="./app/esriLoadConfig.js"></script>
26-
<script src="./app/esriSystemLoadBrowser.js"></script>
27+
<script src="app/esriLoadConfig.js"></script>
28+
<script src="app/esriSystemLoadBrowser.js"></script>
2729
</body>
2830

2931
</html>

0 commit comments

Comments
 (0)