To easily maintain AngularJS SDK, we have completely rewritten the first version. As always, to make our SDKs better, we’d like to hear from you - download the latest version from here or npm, and let us know what you think.

Architecture

With the new release, we moved away from the one-module-per-git-repository approach and bundled all modules inside one git repository. The new repo that should be used is baasic-sdk-angularjs - note that git tags 2.x and later should be used for new development, as 1.x versions are deprecated. We retained the same build process, so the SDK can be built using build instructions below. We kept the same naming and structure for backward compatibility. AngularJS SDK automatically handles Baasic token storage and similar features. Another important thing to mention is Baasic model extensibility - all you need to do is to add your properties and save the model using AngularJS service. AngularJS SDK now depends on Baasic JavaScript SDK, and it’s backward compatible with older versions. Note that applications not using module services - various low-level services such as baasicApp or baasicApiHttp - may experience breaking changes. Please read the next section for more details.

Changes

  • HAL+JSON - if you have been using HAL format explicitly, then you need to add enableHALJSON: true to the configuration
  • Routes
    • if routes were directly expanded, then you should change baasicFileRouteService.streams.create.expand(data) to baasicFileRouteService.streams.create(data)
    • if routes were directly changed, then you should change userService.routeService.find to userService.routeService.findRoute
  • if the token object was accessed directly
    • token.token\_type should be changed to token.type
    • token.access\_token should be changed to token.token
    • token.access\_url\_token should be changed to token.tokenUrl
  • Calls to recaptchaService.challenge() should be removed since Google ReCaptcha has been upgraded

What’s included in the RC version

  • Modules
    • Core communication
    • Membership & Security
    • Key Value & Value Set module
    • Dynamic Resource module
    • Article module
    • Profile module
    • Notification module
    • Templating module
    • Metering module
    • Media Vault & Files module

Initialization

To be able to use the library, you will need to add Baasic (baasic.api) dependency to your AngularJS module.

angular.module('my-module', ["baasic.api"])

Application Configuration

Baasic AngularJS library allows you to use multiple Baasic applications in your AngularJS modules. To initialize a Baasic application, add the following code to your module configuration:

module.config(["baasicAppProvider",
    function (baasicAppProvider) {
        var app = baasicAppProvider.create("<api-key>", {
            apiRootUrl: "api.baasic.com",
            apiVersion: "<version>"
        });
    }]);

Note: To obtain the Baasic Application Identifier, please create your application on the Baasic Registration page.

To get more information about the configuration, please visit Baasic Developer Center or GitHub repository baasic-sdk-angularjs.

Coming soon

We are moving forward with Angular SDK (v2+), which will be released soon after AngularJS. React and Node.js are next on our roadmap, so stay tuned.

Feel free to leave a comment

comments powered by Disqus