From 5938f0b65f8d8876cfa35d3f526e2f8bc3addf99 Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Wed, 18 Mar 2015 17:34:47 -0500 Subject: [PATCH] view this --- playground/views/index.html | 37 ++++++++++++++++++++++++ playground/views/main.html | 15 ++++++++++ playground/views/main.js | 18 ++++++++++++ src/components/app/_scaffolding.scss | 3 ++ src/components/view/view.js | 42 ++++++++++++++++++++++++++++ 5 files changed, 115 insertions(+) create mode 100644 playground/views/index.html create mode 100644 playground/views/main.html create mode 100644 playground/views/main.js create mode 100644 src/components/view/view.js diff --git a/playground/views/index.html b/playground/views/index.html new file mode 100644 index 0000000000..9868e58093 --- /dev/null +++ b/playground/views/index.html @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + Loading... + + + + + diff --git a/playground/views/main.html b/playground/views/main.html new file mode 100644 index 0000000000..bf128ce460 --- /dev/null +++ b/playground/views/main.html @@ -0,0 +1,15 @@ + + + + NAV Title + + + + + + CONTENT!! + + + diff --git a/playground/views/main.js b/playground/views/main.js new file mode 100644 index 0000000000..d64cfb482d --- /dev/null +++ b/playground/views/main.js @@ -0,0 +1,18 @@ +import {bootstrap} from 'angular2/core'; +import {Component, Template} from 'angular2/angular2'; +import {View, Content} from 'ionic/components/view/view'; + + +@Component({ selector: '[ion-app]' }) +@Template({ + url: 'main.html', + directives: [View, Content] +}) +class IonicApp { + constructor() { + console.log('IonicApp Start'); + this.attrTitle = 'banana title'; + } +} + +bootstrap(IonicApp) diff --git a/src/components/app/_scaffolding.scss b/src/components/app/_scaffolding.scss index 8dcbcb6d76..36728b31b9 100644 --- a/src/components/app/_scaffolding.scss +++ b/src/components/app/_scaffolding.scss @@ -1,3 +1,6 @@ +html { + height: 100%; +} [ion-app] { @include flex-display(); diff --git a/src/components/view/view.js b/src/components/view/view.js new file mode 100644 index 0000000000..c9a4e018d8 --- /dev/null +++ b/src/components/view/view.js @@ -0,0 +1,42 @@ +import {NgElement, Component, Template} from 'angular2/angular2'; +import {Ion} from '../ion'; + +@Component({ + selector: 'ion-view', + bind: { + title: 'view-title' + } +}) +@Template({ + inline: ` +
+
+
+ {{title}} + +
+
+ +
` +}) +export class View extends Ion { + constructor(@NgElement() ele:NgElement) { + ele.domElement.classList.add('view'); + } +} + + +@Component({ + selector: 'ion-content' +}) +@Template({ + inline: ` +
+ +
` +}) +export class Content extends Ion { + constructor(@NgElement() ele:NgElement) { + ele.domElement.classList.add('content'); + } +}