Qlik Community

Qlik Sense Integration, Extensions, & APIs

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

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

Angular js mashup Issue

Hello Qlikers,
We built our mashup using Angular js, and we have created a directive to get the objects and display them into a web page, which works fine, but when the user navigates one page to another, using navigation panel, we are getting this error. This is not in the continuous sometime middle of nowhere this issue occurs.
we are thinking because we are navigating one page to another in quick succession it's not rendering and losing the connection with qlik sense.

Could anyone please provide the insights on this to help us resolve the issue, we need to take different strategy or anything else.

 

 

 

 

module.directive('objectDirective', function(OpenApp) {
	return {
		restrict: 'E',
		template: "<div class='sense-object'></div>",
		controller: [
			'$scope',
			'$attrs',
			'$element',
			'OpenApp',

			function($scope, $attrs, $element, OpenApp) {
				let height = $attrs.height ? $attrs.height + 'px' : '66vh';
				let noInteraction = $attrs.interaction ? true : false;
				let noSelections = $attrs.selections ? true : false;
				let vizList = [];
				$element.find('div').css('height', height);
				var app = null;
				
                    if(window.constst){
                    
                        window.constst.visualization.get($attrs.id).then(function(vis) {
                        console.log("Comfing from if cond")
                                vis.show($element.find('div')[0], {
                                    noInteraction: noInteraction,
                                    noSelections: noSelections,
                                });
                                }, (e)=>{

                                    console.log("Not rendering object promise",e)
                                    // OpenApp.getQlikApp().then(res => {
                                    //     res.visualization.get($attrs.id).then(function(vis) {
                                    //     console.log("Comfing from else cond")
                                    //         vis.show($element.find('div')[0], {
                                    //             noInteraction: noInteraction,
                                    //             noSelections: noSelections,
                                    //         });
            
                                    //         vizList = vis;
                                    //     });
                                    // })


                                });

                    }else{
				
					   	OpenApp.getQlikApp().then(res => {
						res.visualization.get($attrs.id).then(function(vis) {
						console.log("Comfing from else cond")
							vis.show($element.find('div')[0], {
								noInteraction: noInteraction,
								noSelections: noSelections,
							});

							vizList = vis;
						});
					});
				
				
				}
			
				 
			},
		],
	};
});

 

 

 

           
Labels (4)