[progress Communities] [progress Openedge Abl] Forum Post: Re: Service Initialization

  • Thread starter Thread starter Radoslav Kirilov
  • Start date Start date
Status
Not open for further replies.
R

Radoslav Kirilov

Guest
Hi Louis, To achieve the desired functionality, you can try using following approach: Create a custom module in the app extension folder. When state is changed inject the mylibService and request your external resource: For example: export default angular.module('app.extensions.module', [ ]).run(['$state', '$rootScope', 'mylibService', function($state, $rootScope, mylibService) { $rootScope.$on('$stateChangeStart', (event, toState, toParams) => { // extend the resolve method of each state toState.resolve.mylibServiceUris= ['$q', ($q) => { return mylibService.getServiceUri(); }]; }); }]) .name; Also, I suggest you to not execute http calls with promises in the service constructors, since testing such services with unit tests can be very tricky (to mock the http call). More about custom modules and services you can find here: https://community.progress.com/community_groups/openedge_kendo_ui_builder/w/openedgekendouibuilder/2924.how-to-add-a-custom-module-and-service-in-kendo-ui-builder-2-0 Best, Rado

Continue reading...
 
Status
Not open for further replies.
Back
Top