Last active
May 9, 2016 07:08
-
-
Save tamebadger/6d678d72d5bb8cd00d894bd346725fcd to your computer and use it in GitHub Desktop.
Chatroom App Demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import config from './config/environment'; | |
const Router = Ember.Router.extend({ | |
location: 'none' | |
}); | |
Router.map(function() { | |
this.route('friends') | |
this.route('users') | |
this.route('chatrooms',function(){ | |
this.route('room',{path:'/:id'}) | |
}) | |
}); | |
export default Router; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import { chatrooms } from './data' | |
export default Ember.Route.extend({ | |
model(){ | |
return chatrooms | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const users = Ember.A([ | |
{id: 1, name: 'User 1'}, | |
{id: 2, name: 'User 2'}, | |
{id: 3, name: 'User 3'}, | |
{id: 4, name: 'User 4'} | |
]) | |
export const chatrooms = Ember.A([ | |
{id: 1, name:'Chatroom 1', messages: [ | |
{title:'Hey there!',user:users[0]}, | |
{title:'Hello User 1',user:users[1]}, | |
{title:'Hi Guys',user:users[2]}, | |
{title:'HMmm everyone is just saying hello',user:users[3]}, | |
]}, | |
{id: 2, name:'Chatroom 2'}, | |
{id: 3, name:'Chatroom 3'}, | |
{id: 4, name:'Chatroom 4'} | |
]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember' | |
import { chatrooms } from './data' | |
export default Ember.Route.extend({ | |
model(){ | |
return chatrooms | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
margin: 12px 16px; | |
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
font-size: 12pt; | |
min-height: 100vh; | |
} | |
.flex-container{ | |
display: flex; | |
min-height: 100vh; | |
} | |
.flex-sidebar{ | |
background: gray; | |
flex: 1; | |
} | |
.flex-content{ | |
flex: 2; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.8.0", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.5.1", | |
"ember-data": "2.5.2", | |
"ember-template-compiler": "2.5.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment