File tree Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ /**
2+ * Model is the base class for all data models and is intended to be the base
3+ * class for all data models.
4+ * @class
5+ */
6+ export class Model {
7+ constructor ( ) {
8+ // Initialize properties
9+ }
10+ static get properties ( ) {
11+ return { }
12+ }
13+ toString ( ) {
14+ return JSON . stringify ( this ) ;
15+ }
16+ }
Original file line number Diff line number Diff line change 11
22// This file defines all the styles and elements used for the web components
33
4+ // Core
5+ import './core/Model' ;
6+ import './core/Provider' ;
7+
48// Buttons
59import './component/button/ButtonElement' ;
610import './component/button/ButtonGroupElement' ;
Original file line number Diff line number Diff line change 33// Core
44import Provider from './core/Provider' ;
55import Event from './core/Event' ;
6+ import { Model } from './core/Model' ;
7+
8+ // Create a model
9+
10+ class MyModel extends Model {
11+
12+ }
613
714// Test
815window . addEventListener ( 'load' , ( ) => {
@@ -69,4 +76,8 @@ window.addEventListener('load', () => {
6976 }
7077 } ) ;
7178 } ) ;
79+
80+ // Print out model
81+ var model = new MyModel ( { name : "John Doe" , age : 21 } ) ;
82+ console . log ( "" + model ) ;
7283} ) ;
You can’t perform that action at this time.
0 commit comments