Starting out with Ember.JS

4,808 Kb

How do I make an starting out with ember.js?

Following along What is a starting out with ember.js? How do you make a starting out with ember.js? This script and codes were developed by Christian Fleschhut on 11 August 2022, Thursday.

Starting out with Ember.JS Previews

Starting out with Ember.JS - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Starting out with Ember.JS</title> <script src="" type="text/javascript"></script>
<meta name='viewport' content='width=device-width, initial-scale=1'> <link rel="stylesheet" href=""> <link rel='stylesheet prefetch' href=''> <link rel="stylesheet" href="css/style.css">
<body> <script data-template-name='application' type='text/x-handlebars'> <div class='navbar navbar-default navbar-fixed-top'> <div class='container'> <div class='navbar-header'> {{#link-to 'index' class='navbar-brand'}}EmberFoo{{/link-to}} </div> <div class='navbar-collapse collapse'> <ul class='nav navbar-nav navbar-right'> {{#link-to 'index' tagName="li"}} <a>Home</a> {{/link-to}} {{#link-to 'products' tagName="li"}} <a>Products</a> {{/link-to}} {{#link-to 'about' tagName="li"}} <a>About</a> {{/link-to}} </ul> </div> </div> </div> <div class='container'> {{outlet}} </div> <footer class='container'> <hr> <p> {{#link-to 'credits'}} Credits {{/link-to}} </p> </footer>
<script data-template-name='index' type='text/x-handlebars'> <div class='page-header'> <h1> Welcome </h1> </div> <p> <img {{bind-attr src='logo' class=':thumbnail'}}> </p> <p> {{#link-to 'products' class='btn btn-primary'}} Browse all {{productsCount}} products » {{/link-to}} </p> <p> Rendered on {{time}}. </p> <div class='row'> {{#each onSale}} <div class='col-sm-4'> <h4> {{title}} </h4> <p> {{#link-to 'products.onsale'}} <span class='label label-warning'> On Sale </span> {{/link-to}} </p> <p> <img {{bind-attr src='image'}}> </p> <p> {{description}} </p> <p> {{#link-to 'product' this class='btn btn-default btn-sm'}} Buy for ${{price}} {{/link-to}} </p> </div> {{/each}} </div>
<script data-template-name='products' type='text/x-handlebars'> <ol class='breadcrumb'> <li> {{#link-to 'index'}} Home {{/link-to}} </li> <li> Products </li> </ol> <div class='page-header'> <h1> Products </h1> </div> <div class='row'> <div class='col-md-3'> <ul class='nav nav-pills nav-stacked'> {{#each}} {{#link-to 'product' this tagName='li'}} <a>{{title}}</a> {{/link-to}} {{/each}} </ul> </div> <div class='col-md-9'> {{outlet}} </div> </div>
<script data-template-name='product' type='text/x-handlebars'> <h2> {{title}} </h2> <figure> <img {{bind-attr src='image'}}> <figcaption> {{description}} </figcaption> </figure> <p> {{#link-to 'product' tagName='button' class='btn btn-success'}} Buy for {{price}} $ {{/link-to}} </p> <h3> Reviews </h3> <ul> {{#each reviews}} <li> {{text}} </li> {{else}} <li> <em>No reviews yet. Be the first to write one!</em> </li> {{/each}} </ul>
<script data-template-name='products/index' type='text/x-handlebars'> <div class='alert alert-info'> Choose a product from those on the left! </div>
<script data-template-name='products/onsale' type='text/x-handlebars'> {{#each}} <div class='product--onsale'> <h4> {{title}} </h4> <p> <img {{bind-attr src='image'}}> </p> <p> {{description}} </p> <p> {{#link-to 'product' this class='btn btn-default btn-sm'}} Buy for ${{price}} {{/link-to}} </p> </div> {{/each}}
<script data-template-name='about' type='text/x-handlebars'> <ol class='breadcrumb'> <li> {{#link-to 'index'}} Home {{/link-to}} </li> <li> About </li> </ol> <div class='page-header'> <h1> About </h1> </div> <p> {{contactName}} </p> <p> <span class='label label-info'> {{open}} </span> </p>
<script data-template-name='credits' type='text/x-handlebars'> <ol class='breadcrumb'> <li> {{#link-to 'index'}} Index {{/link-to}} </li> </ol> <div class='page-header'> <h1> Credits </h1> </div>
<script src=''></script>
<script src=''></script>
<script src=''></script>
<script src=''></script> <script src=''></script> <script src="js/index.js"></script>

Starting out with Ember.JS - Script Codes CSS Codes

body { padding-top: 70px;

Starting out with Ember.JS - Script Codes JS Codes

var App = Ember.Application.create({ LOG_TRANSITIONS: true
App.ApplicationAdapter = DS.FixtureAdapter.extend(); { this.resource('products', function() { this.resource('product', { path: ':product_id' }); this.route('onsale'); }); this.route('about'); this.route('credits', { path: '/thanks' });
App.IndexRoute = Ember.Route.extend({ model: function() { return'product'); }
App.IndexController = Ember.ArrayController.extend({ productsCount: Ember.computed.alias('length'), onSale: function() { return this.filterBy('isOnSale').slice(0, 3); }.property('@each.isOnSale'), logo: '', time: function() { return (new Date()).toDateString(); }.property()
App.AboutController = Ember.Controller.extend({ contactName: 'Firstname Lastname', avatar: 'images/avatar.png', open: function() { return ((new Date()).getDay() === 0 ? 'Closed' : 'Open'); }.property()
App.ProductsRoute = Ember.Route.extend({ model: function() { return'product'); }
App.ProductRoute = Ember.Route.extend({ model: function(params) { return'product', params.product_id); }
App.ProductsOnSaleRoute = Ember.Route.extend({ model: function() { return this.modelFor('products').filterBy('isOnSale'); }
App.ProductsController = Ember.ArrayController.extend({ sortProperties: ['title'], sortAscending: false
App.Product = DS.Model.extend({ title: DS.attr('string'), price: DS.attr('number'), description: DS.attr('string'), isOnSale: DS.attr('boolean'), image: DS.attr('string'), reviews: DS.hasMany('review', { async: true })
App.Review = DS.Model.extend({ text: DS.attr('string'), reviewedAt: DS.attr('date'), product: DS.belongsTo('product')
App.Product.FIXTURES = [ { id: 1, title: 'a Product 01', price: 1500, description: 'description product01 lorem ipsum', isOnSale: true, image: '', reviews: [100, 101] }, { id: 2, title: 'b Product 02', price: 2500, description: 'description product02 lorem ipsum', isOnSale: true, image: '' }
App.Review.FIXTURES = [{ id: 100, text: 'Review 1 Placeholder Lorem Ipsum', product: 1
}, { id: 101, text: 'Review 2 Placeholder Lorem Ipsum', product: 1
Starting out with Ember.JS - Script Codes
Starting out with Ember.JS - Script Codes
Home Page Home
Developer Christian Fleschhut
Username cfleschhut
Uploaded August 11, 2022
Rating 3
Size 4,808 Kb
Views 24,276
Do you need developer help for Starting out with Ember.JS?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Christian Fleschhut (cfleschhut) Script Codes
Create amazing marketing copy with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!