[search] Make search result clickable
authorErik Haider Forsén <erik@forsen.not>
Sun, 15 Nov 2015 11:49:42 +0000 (12:49 +0100)
committerErik Haider Forsén <erik@forsen.not>
Sun, 15 Nov 2015 11:49:42 +0000 (12:49 +0100)
src/components/search/search.html
src/components/search/search.ts

index 2d6495f..095c123 100644 (file)
@@ -1,19 +1,20 @@
-
-    <section class="form-group">
-        <label class="sr-only" for="livesearch">Search</label>
-        <input
-                mou-live-search
-                (results)="orgunits = $event"
-                (loading)="loading = $event"
-                type="text"
-                autofocus
-                id="livesearch">
-        <img style="width: 20px; position: absolute;"
-             [hidden]="!loading"
-             src="https://www.brown.edu/sites/default/themes/pawtuxet/img/loader-larger.gif">
-    </section>
-    <section>
-        <div *ng-for="#orgunit of orgunits" style="padding: 0.5em 0.5em 0.5em 0;">
-            <p>{{orgunit.name}}</p>
-        </div>
-    </section>
+<section class="form-group">
+    <label class="sr-only" for="livesearch">Search</label>
+    <input
+            mou-live-search
+            (results)="orgunits = $event"
+            (loading)="loading = $event"
+            type="text"
+            autofocus
+            id="livesearch">
+    <img style="width: 20px; position: absolute;"
+         [hidden]="!loading"
+         src="https://www.brown.edu/sites/default/themes/pawtuxet/img/loader-larger.gif">
+</section>
+<section>
+    <ul>
+        <li *ng-for="#orgunit of orgunits" (click)="getMoreInfo(orgunit)" style="padding: 0.5em 0.5em 0.5em 0;">
+            {{orgunit.name}}
+        </li>
+    </ul>
+</section>
index 951c866..7d9501e 100644 (file)
@@ -10,8 +10,11 @@ export class Search {
     orgunits: Array<any> = [];
     loading: boolean = false;
 
-    constructor(){
+    getMoreInfo(orgunit){
+        console.log(orgunit.id);
     }
+
+
 }