1.0.0-2 • Published 4 years ago
@gambleon/ng-commons v1.0.0-2
ng-commons
Common Models and Services for Angular Single Page Applications (SPAs)
Models
KeyValuePairs
- KeyValuePair
Json example:
[
{
"key": "winter",
"value": "Winter"
},
{
"key": "spring",
"value": "Frühling"
},
{
"key": "summer",
"value": "Sommer"
},
{
"key": "autumn",
"value": "Herbst"
}
]
Dictionaries
A more compact representation for a key-value-pair mapping.
Can be iterated in angular using the | keyvalue
-pipe
- Dictionary
Json example:
{
"winter": "Winter",
"spring": "Frühling",
"summer": "Sommer",
"autumn": "Herbst"
}
Other Models
- Notification
Contain the message and status (isSuccess) delivered by the NotificationService.
Services
NotificationService
Ability to dispatch messages using onSuccess()
and onError()
which can be received by subscribing to getNotification()
.
The status of the Notification can be used to alter the visual appearance.