ExLibrisGroup/primo-explore-devenv

main.js: no angular or app variables?

Closed this issue · 2 comments

I'm experimenting with the --browserify option in Primo VE, and trying to get the basic Hello World running from this tutorial, using main.js:

app.component('myInstitutionComponent', {
    template: `<span style="margin-left: 40%;">Hello World</span>`
});

However, I'm getting the Uncaught ReferenceError: app is not defined error in my console (which makes sense, of course).

So is app, or maybe angular, meant to be imported from a module somewhere?

I understand that --browserify is pretty unsupported. But I would really like it to work, so I can use ES2015, npm modules, etc. I would be a big fan.

Thanks!

Hi @allanberry - do you have the following declared in your code?
var app = angular.module('viewCustom', ['angularLoad']);

Thanks @noamamit92, that's what I needed. Much obliged, it works now.

Is that documented anywhere? I wonder what other elementary things I don't know. :)