1 Reply Latest reply: Mar 22, 2017 9:33 AM by Yianni Ververis RSS

    MashUp AngularJS get objects

    paolo Deregibus

      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