UNPKG

baasic-sdk-angularjs

Version:

AngularJS SDK provides core functionality for building web and mobile applications on [Baasic](http://www.baasic.com/).

55 lines (29 loc) 1.12 kB
# baasicUriTemplateService This is the core Uri template service wihch expands templates based on on [RFC6570](http://tools.ietf.org/html/rfc6570) specifications and can expand templates up to and including Level 4 in that specification. * * * ### baasicUriTemplateService.parse() Parses and expands URI templates based on [RFC6570](http://tools.ietf.org/html/rfc6570) specifications. For more information please visit the project [GitHub](https://github.com/Baasic/uritemplate-js) page. **Example**: ```js baasicUriTemplateService.parse( '<route>/{?embed,fields,options}' ).expand( {embed: '<embedded-resource>'} ); ``` ### baasicUriTemplateService.constructTemplateUrl() Constructs template Url based on given arguments. **Example**: ```js baasicUriTemplateService.constructTemplateUrl({ templateText : UriTemplate.parse('<route>/{searchTerm}/{rpp}/{page}/{sort}'), defaultUrl : 'route' }, { search : '<search-phrase>', pageNumber : 1, pageSize : 10, orderBy : '<field>', orderDirection : '<asc|desc>' }); ``` * * *