File tree 3 files changed +31
-0
lines changed
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 1
1
2
2
// This file defines all the styles and elements used for the web components
3
3
4
+ // Core
5
+ import './core/Model' ;
6
+ import './core/Provider' ;
7
+
4
8
// Buttons
5
9
import './component/button/ButtonElement' ;
6
10
import './component/button/ButtonGroupElement' ;
Original file line number Diff line number Diff line change 3
3
// Core
4
4
import Provider from './core/Provider' ;
5
5
import Event from './core/Event' ;
6
+ import { Model } from './core/Model' ;
7
+
8
+ // Create a model
9
+
10
+ class MyModel extends Model {
11
+
12
+ }
6
13
7
14
// Test
8
15
window . addEventListener ( 'load' , ( ) => {
@@ -69,4 +76,8 @@ window.addEventListener('load', () => {
69
76
}
70
77
} ) ;
71
78
} ) ;
79
+
80
+ // Print out model
81
+ var model = new MyModel ( { name : "John Doe" , age : 21 } ) ;
82
+ console . log ( "" + model ) ;
72
83
} ) ;
You can’t perform that action at this time.
0 commit comments