New working structure after par programmering
authorErik Haider Forsén <erikhf@ifi.uio.no>
Thu, 12 Nov 2015 10:14:39 +0000 (11:14 +0100)
committerErik Haider Forsén <erikhf@ifi.uio.no>
Thu, 12 Nov 2015 10:14:39 +0000 (11:14 +0100)
package.json
src/components/app.html [new file with mode: 0644]
src/components/app.ts [new file with mode: 0644]
src/components/app/app.ts [deleted file]
src/components/map/map.html [new file with mode: 0644]
src/components/map/map.ts
src/index.html

index 6dd73f0..077cd86 100644 (file)
@@ -19,6 +19,7 @@
     "systemjs": "0.19.2"
   },
   "devDependencies": {
+    "bootstrap": "^3.3.5",
     "live-server": "^0.8.2",
     "typescript": "^1.6.2"
   }
diff --git a/src/components/app.html b/src/components/app.html
new file mode 100644 (file)
index 0000000..43c0a4c
--- /dev/null
@@ -0,0 +1,4 @@
+Hello world!
+
+
+<mou-map></mou-map>
\ No newline at end of file
diff --git a/src/components/app.ts b/src/components/app.ts
new file mode 100644 (file)
index 0000000..71b4542
--- /dev/null
@@ -0,0 +1,19 @@
+import {HTTP_PROVIDERS} from 'angular2/http';
+import {Component, View, bootstrap, provide} from 'angular2/angular2';
+import {Map} from './map/map';
+
+declare var System:any;
+
+@Component(
+    {
+        selector: 'mou-app',
+        templateUrl: './components/app.html',
+        directives:[Map]
+    })
+
+
+class App {
+
+}
+
+bootstrap(App);
\ No newline at end of file
diff --git a/src/components/app/app.ts b/src/components/app/app.ts
deleted file mode 100644 (file)
index 39a3db0..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-import {bootstrap, Component, CORE_DIRECTIVES} from 'angular2/angular2';
-import {map} from '../map/map';
-@Component({
-    selector: 'hello-world',
-    directives: [CORE_DIRECTIVES],
-    template: `
-        <h1>Hello World</h1>
-        <p>This is just a sample template yeah!</p>
-        <p>{{getApiURI()}}</p>
-    `
-})
-
-
-class App {
-
-    getApiURI(){
-        return dhisAPI;
-    }
-
-}
-
-bootstrap(App);
diff --git a/src/components/map/map.html b/src/components/map/map.html
new file mode 100644 (file)
index 0000000..58d14d4
--- /dev/null
@@ -0,0 +1 @@
+<div>Her kommer et fint kart</div>
\ No newline at end of file
index c79ac10..d3e329d 100644 (file)
@@ -1,23 +1,15 @@
-import {Component, CORE_DIRECTIVES} from '../../../node_modules/angular2/angular2.d.ts';
+import {Component, CORE_DIRECTIVES} from 'angular2/angular2';
 
 @Component({
-    selector: 'map',
+    selector: 'mou-map',
     directives: [CORE_DIRECTIVES],
-    template: ` <div id="map"></div>`
-    //templateUrl: './map.html'
-
-
+    templateUrl: './components/map/map.html'
 })
 
 
-class Map {
-
-
-    initMap() {
-         let map = new google.maps.Map(document.getElementById('map'), {
-           center: {lat: -34.397, lng: 150.644},
-         zoom: 8
-        });
-
+export class Map {
+    writeYolo() {
+        console.log("yol");
     }
+
 }
index f51379f..5fdf54e 100644 (file)
     <script src="../node_modules/systemjs/dist/system.src.js"></script>
     <script src="../node_modules/angular2/bundles/angular2.dev.js"></script>
     <script src="../node_modules/angular2/bundles/http.dev.js"></script>
+    <script src="../node_modules/angular2/bundles/router.dev.js"></script>
+
+
+
     <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
     <script>
         System.config({
             packages: {'components': {defaultExtension: 'js'}}
         });
-        System.import('components/app/app');
+        System.import('components/app');
     </script>
 </head>
 <body>
-    <hello-world>loading...</hello-world>
+    <mou-app>loading...</mou-app>
 </body>
 </html>