Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
petercappelle
Partner - Contributor III
Partner - Contributor III

RequireJS necessary in Qlik Sense Mashup

Hi,

At the moment i'm building my own Qlik Sense mashup with hypercubes (Angular way).

By default requireJS is one of the things that is provided by Qlik Sense if you make a new mashup, but is it really necessary to use? I would rather like to use a good written Gulp file that concat & minify my controllers, modules, directives into one file.

on my development side i just want to try and learn AngularJS, but somehow requireJS is always giving me unwanted trouble.

There is an example here: Service Charges of a mashup made on top of the Qlik Sense engine and if you drill into the code there is no requireJS used. That's why i have the previous question 'Is there a way to let the requireJS out of my code'?

6 Replies
Alexander_Thor
Employee
Employee

RequireJS is our module loader that will load the necessary javascript modules client side, so yes it's needed to get a working mashup up and running.

However, you can still concat your files and run Gulp as a task runner while still using require in the client to load modules. It's different tech and serves different purposes.

Francis_Kabinoff
Former Employee
Former Employee

Hi Peter,

The example you reference actually uses the Qlik Engine API, not the Capability or Mashup API.

Here's a few resources on using Angular with Capability or Mashup API -

http://help.qlik.com/sense/2.1/en-us/developer/#../Subsystems/Mashups/Content/Howtos/mashups-use-ang...

https://github.com/erikwett/helpdesk-angular/blob/master/helpdesk-angular.js

And if you are using Qlik Sense 2.1.1, be sure to check out the comment section on this page

http://branch.qlik.com/projects/showthread.php?584-Mashup-with-AngularJS&highlight=template

petercappelle
Partner - Contributor III
Partner - Contributor III
Author

Thank you that is a clear answer, however i do not agree for hundred procent. If you concat your files than requireJS isn't really necessary anymore. I'm just not that familiar with RequireJS, for example all cubes and callbacks have to come inside of this require function, aren't they?

require( ["js/qlik"], function ( qlik ) { qlik.setOnError( function ( error ) { alert( error.message ); } );

});

I have about 70 cubes, so you can imagine how many lines of code i have between this require function.

petercappelle
Partner - Contributor III
Partner - Contributor III
Author

Hi Francis, Thank you for the examples! They are more than welcome.

This Qlik engine API, isn't that the expensive solution (>50.000 euro) or am i wrong? Maybe in the future it's word the investment but for now we would like to start with the Mashup API.

Regards!

ErikWetterberg

Hi Peter,

You dont have to create all your cubes inside this function, you could do something like

function createCube1(app){

app.createCube(.....);

}

require(["js/qlik"],function(qlik){

   var app = qlik.openApp(....);

   createCube1(app);

});

/Erik

petercappelle
Partner - Contributor III
Partner - Contributor III
Author

Thank you! This is indeed a good alternative.

akl‌ Do you have some good examples how i can use and talk to the Qlik Sense Engine API? Do i for example still need to use Hypercubes?

Next to these questions i was wondering what is the big difference between Qlik Engine API and the Mashup API? What i have made till now are around 70 hypercubes (using senseUtils multicube). In the callbacks i build my charts using the Highcharts library and then i have append() some KPI's and labels out of a Hypercube to the DOM elements.

Untill now i did not use any Angular code, all was accomplished with jQuery. Now i want to get a step further and use Angular. What does this choice change at the way i use Hypercubes, do i for example still need the requireJS than? There isn't very much info and examples on the internet, because it's still quiet new. So excuse me for the many "i could use some help to understand" questions.