-
Notifications
You must be signed in to change notification settings - Fork 0
home
To get a better understanding of Baasic AngularJS services bellow are the details of the main architecture to which all the library services conform to.
- Baasic App. Settings SDK Documentation
- Baasic Articles SDK Documentation
- Baasic Dynamic Resource SDK Documentation
- Baasic Key Value SDK Documentation
- Baasic Membership SDK Documentation
- Baasic Security SDK Documentation
- Baasic Value Set SDK Documentation
-
baasicApp service is used to manage Baasic application instances. Multiple AngularJS application instances can be created and coexist at the same time (each will communicate with its corresponding Baasic application)
For more information please visit the baasicApp documentation.
-
baasicApiHttp
Baasic HTTP service is used to perform low level communication with the Baasic back-end.
For more information please visit the baasicApiHttp documentation.
-
baasicApiService
This service is used to perform low level model or option transformations before they are sent to the Baasic back-end.
For more information please visit the baasicApiService documentation.
-
baasicConstants
Baasic constants contain values such as id property name and model property name parameters that can be used in case manual model or option transformation is needed.
Resources returned from Baasic are by default in HAL format and they look similar to this:
{
"key": "<key>",
"value": "<value>",
"dateCreated": "2015-01-01T14:24:56.795849Z",
"dateUpdated": "2015-01-01T14:24:56.795849Z",
"id": "kZyiWLUzz8dqAjHiO1gxXK",
"_links": {
"self": {
"href": "https://api.baasic.com/<version>/<api-key>/key-values/<key>",
"templated": false
},
"post": {
"href": "https://api.baasic.com/<version>/<api-key>/key-values",
"templated": false
},
"put": {
"href": "https://api.baasic.com/<version>/<api-key>/key-values/<key>",
"templated": false
},
"delete": {
"href": "https://api.baasic.com/<version>/<api-key>/key-values/<key>",
"templated": false
}
},
"_embedded": { }
}
Note: The preferred way of accessing Bassic back-end is through use of AngularJS SDK services. For manual access to the back-end URL's you can use this (or similar) code:
data.links('put').href
data.links('delete').href
You can for example also create your own update
function by using Baasic core services:
update: function (data) {
var params = baasicApiService.updateParams(data);
var url = params[baasicConstants.modelPropertyName].links('put').href;
var model = params[baasicConstants.modelPropertyName];
return baasicApiHttp.put(url, model);
},
Baasic built-in models can be extended with custom properties by simply setting property values.
article.myProperty = 1;
article.myPropertyObject = {
firstProp: 1,
secondProp: 2
}
update: function (article) {
return articleService.update(article);
}
This powerful feature allows you to extend all built-in models with custom properties which allows modules like Article to fully suit your needs.