Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

paoloderegibus
New Contributor II

MashUp AngularJS get objects

Hello community,

I am working on a mashup project which uses angularJS to manage the application and the navigation, and embed some qlik sense objects in the pages.

I am new to angular so I think I am probably miss something about the interaction it has with QS APIs.

So far everything seems to work except the navigation between the pages: the first time a page is shown it works correctly. On the other hand if the users goes back to an already visited page, the custom HTML components (inlcuding components that retreive data via QS APIs) are loaded correctly, while the embedded QS objects do not appear in their containers. QS objects appear again if the user refreshes the page.

To navigate from a page to an other I am using an ng-view that calls different template based on the route, all views share the same controller.

Below the code.

index.html:

<div ng-view cache-view="false"></div>

myApp.js:

myApp.config( function ( $routeProvider ) {

        $routeProvider.when( '/competitorsAnalysis', {

            templateUrl: 'templates/pages/competitorsAnalysis.html'

        } )

        .when( '/yearOnYear', {

            templateUrl: 'templates/pages/yearOnYear.html'

        } )

        .otherwise( {

                templateUrl: 'templates/pages/competitorsAnalysis.html'

            } );

    } );

Any help would be very appriciated.

Thanks in advance!

Paolo

4 Replies
Employee
Employee

Re: MashUp AngularJS get objects

Try resizing on every route change or on when controller/component is loaded

qlik.resize()

Yianni

frank_packer_at
New Contributor

Re: MashUp AngularJS get objects

I'm experiencing a similar problem whereby items requested via .getObject do not render at times. A few page refreshes usually causes them to render correctly, so it appears to be something to do with network latency, but I'm not sure what.

Calling qlik.resize() as advised above does not help in this case.

Any further ideas for resolving this would be much appreciated!

nivedha_v
New Contributor II

Re: MashUp AngularJS get objects

The app.getObject typically refers to the cache and when you switch between two controllers for navigation but using the same app, the initially fetched objects may have been cleared off the cache but getObject still tries to fetch from cache. We faced a similar issue and tried to keep the pages within the same controller and it works.

We have an example of angular grid mashup. Please check out the source code.

Another option is to use the Visualization API

https://help.qlik.com/en-US/sense-developer/April2018/Subsystems/APIs/Content/CapabilityAPIs/Visuali...

frank_packer_at
New Contributor

Re: MashUp AngularJS get objects

The visualization API option appears to be working.

Thanks Nivedha!