Skip to content

Commit 5d0bf89

Browse files
authored
Update README.md
1 parent fd0e822 commit 5d0bf89

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,4 +929,71 @@ Smart('smart-repeat-button', class RepeatButton extends Smart.Button {
929929
});
930930
```
931931
932+
## Comparison with Polymer Framework
933+
934+
Polymer is a Google-sponsored project. With Polymer, you can build custom elements. Smart Custom Elements can be compared to Polymer’s custom elements and both provide a very similar development style.
935+
936+
Similar things:
937+
938+
Elements are instantiated using a constructor or document.createElement. Elements are instantiated when the tag is written in the DOM.
939+
Configured using attributes or properties
940+
Populated with internal DOM inside each instance
941+
Responsive to property and attribute changes
942+
Styled with internal defaults or externally
943+
Responsive to methods that manipulate its internal state
944+
945+
Different things:
946+
947+
Property types can be nullable and more strict - validation for Integer. Support for Int64.
948+
Properties can define `allowedValues` array. If a property is set to a value which is not in that array, an exception is thrown.
949+
Property invalid value and invalid type validation.
950+
Complex Nested Properties. Smart supports property nesting.
951+
952+
Example:
953+
954+
`
955+
'paging': {
956+
value: {
957+
'enabled': {
958+
value: false,
959+
type: 'boolean'
960+
},
961+
'pageSize': {
962+
value: 10,
963+
type: 'int',
964+
validator: 'pageSizeValidator'
965+
},
966+
'pageIndex': {
967+
value: 0,
968+
type: 'int',
969+
validator: 'pageIndexValidator'
970+
}
971+
},
972+
type: 'object'
973+
}
974+
`
975+
976+
For setting `pageSize`, this could be used: grid.paging.pageSize = 15;
977+
978+
Initialization of an element from a JSON object with automatic Dependency Changes handling. When an element is created from a JSON object, the json it two-way bound to the element and any change in the element updates the JSON.
979+
HTMLTemplates support. When in the Custom Element's template, we have HTMLTemplateElement, that template is re-evaluated on property change and can be used for dynamic user updates.
980+
Method Arguments and Return Type. Smart validates Methods for Invalid return type, Arguments Count, Arguments Types.
981+
Agnostic Events - Smart exposes custom events for 'down', 'up', 'move' and 'swipe'. These events are Device agnostic and are raised for Touch and Desktop devices when the Cursor/Pointer is down, up, moved or swiped left, right, up or down.
982+
Multiple Element Versions on the same web page is supported.
983+
Localization - Built-in localization support.
984+
Error Logs - Error logs with different error levels.
985+
`completed` lifecycle callback which is called when the local DOM is ready and all elements are rendered.
986+
`resize` notifications when the element's size is changed.
987+
Style changed notifications - when the element's CSS is changed.
988+
Using Shadow DOM is optional and is user preference. When disabled, the element's local DOM is part of the document's DOM.
989+
View-Model Binding. An Element or Multiple Elements can be bound to the same Model object.
990+
991+
992+
993+
994+
995+
996+
997+
998+
932999

0 commit comments

Comments
 (0)