Router.map(function() {
this.resource('article', {path: '/article/:id'}, function() {
this.route('show', {path: '/'});
this.route('edit', {path: '/edit'});
this.route('schedule');
});
/app URLs
-- /templates
article.hbs /article/first-post/
-- /article
show.hbs /article/first-post/
edit.hbs /article/first-post/edit
schedule.hbs /article/first-post/schedule
Router.map(function() {
this.resource('article', {path: '/article/:id'}, function() {
this.route('show', {path: '/'});
this.route('edit', {path: '/edit'});
this.route('schedule');
});
/app URLs
-- /templates
article.hbs /article/first-post/
-- /article
show.hbs /article/first-post/
edit.hbs /article/first-post/edit
schedule.hbs /article/first-post/schedule
Router.map(function() {
this.resource('article', {path: '/article/:id'}, function() {
this.route('show', {path: '/'});
this.route('edit', {path: '/edit'});
this.route('schedule');
});
});
/app URLs
-- /templates
article.hbs /article/first-post/
-- /article
show.hbs /article/first-post/
edit.hbs /article/first-post/edit
schedule.hbs /article/first-post/schedule
Router.map(function() {
this.resource('article', {path: '/article/:id'}, function() {
this.route('show', {path: '/'});
this.route('edit', {path: '/edit'});
this.route('schedule');
});
});
/app URLs
-- /templates
article.hbs /article/first-post/
-- /article
show.hbs /article/first-post/
edit.hbs /article/first-post/edit
schedule.hbs /article/first-post/schedule
Router.map(function() {
this.resource('article', {path: '/article/:id'}, function() {
this.route('show', {path: '/'});
this.route('edit', {path: '/edit'});
this.route('schedule');
});
});
/app URLs
-- /templates
article.hbs /article/first-post/
-- /article
show.hbs /article/first-post/
edit.hbs /article/first-post/edit
schedule.hbs /article/first-post/schedule
<body>
<div class="content">
{{partial "header"}}
{{outlet}}
{{#link-to 'user' "dean"}}
Profile
{{/link-to}}
</div>
</body>
{{partial 'header'}}
{{outlet}}<!--index.hbs-->
{{partial 'footer'}}
Reusable chunk of HTML
General
{{partial 'partial_name'}}
/app
-- /templates
_partial_name.hbs
Reusable chunk of HTML
Example
{{partial 'partials/header'}}
/app
-- /templates
-- /partials
_header.hbs
Change what is shown in an outlet
Link to another template, based on the name
General
{{#link-to ‘route_name’}}
Link Text
{{/link-to}}
Change what is shown in an outlet
Link to another template, based on the name
Example
{{#link-to ‘weather.tomorrow’}}
Tomorrow
{{/link-to}}
{{outlet}}
<div class="row news"> <h1 class="page-header">The News</h1>
{{#link-to "article" 'a-mission-from-god' tagName="h2"}}
Are you the police?
{{/link-to}} No, ma'am. We're musicians. {{#link-to "article" 'a-mission-from-god'}} see more {{/link-to}} .... </div>
npm install -g ember-cli
ember new prototype-name
cd prototype-name
npm install --save-dev broccoli-sass
ember serve
git clone https://github.com/deanmarano/ember-chi ember-chi-pages
cd ember-chi-pages && git checkout -b pages && rm -rf .
cd ../ember-chi && ember build
cp -R dist/* ../ember-chi-pages
cd ../ember-chi-pages && git commit -m "Deploy" && git push
if (environment === 'production') { ENV.locationType = 'hash'; }
ember build --environment=production
Thanks!
@pleiadeez
deanmarano.github.io/ember-chi