Deliver Audacious Web Apps with Ember 2 (for Sandi Frank) by Matthew White

Deliver Audacious Web Apps with Ember 2 (for Sandi Frank) by Matthew White

Author:Matthew White
Language: eng
Format: epub
Tags: Pragmatic Bookshelf
ISBN: 978-1-68050-078-3
Publisher: The Pragmatic Bookshelf, LLC (598618)


Defining a Model’s Fields

As with each of the other classes we’ve created, we define models by first running an Ember CLI command to get a stub version of the class. In ​Adding a Data Service​, we ran the following command to generate our User model class.

​ $ ember generate model user

The stub version of this class had no fields. We’ll add them so that our class looks like this:

ch5/ember-note/app/models/user.js

​ ​import​ DS from ​'ember-data'​;

​ ​export​ ​default​ DS.Model.extend({



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.