1

We are using IBM Web portal to have like little 'components' within a page. These are simple javascript components, some with JQuery maybe. Currently we are exploring Angular as replacement. So basically we want to display multiple small Angular projects on a portal page.

I know it is not recommended and bad practice. Yet I want to explore the options. I managed to get multiple projects running with some effort. Just routing seems to be the biggest problem so far since they are conflicting ofcource. I'm looking for some hints or a push in the right direction. Again, I know it not recommended so something like "Just don't do it" is not very helpfull.

Robin Dijkhof
  • 18,665
  • 11
  • 65
  • 116

2 Answers2

0

One thing you could do is prefix the urls in each of your index.html in the angular projects.

so where it says baseref="/" you can put whatever you want. Then on the devops side depending on what you use to deploy you just write a rule and everytime a client requests a page it'll just route them to that app.

Mike Tung
  • 4,735
  • 1
  • 17
  • 24
0

What version of Portal are you using? I have not worked with angular that much, but you will most likely have to work angular loading into the portal theme and then each portlet could have it's own ng-app like mentioned here: AngularJS Multiple ng-app within a page

Carlos
  • 1,696
  • 1
  • 14
  • 21
  • 1
    Version 8.5. Note: Angular and AngularJS is a huge difference – Robin Dijkhof May 22 '17 at 18:51
  • I have not used Angular 2 yet, but based on a quick search I think the same principal applies. You would have to load angular as part of the Theme and then do something like this: https://blog.sstorie.com/bootstrapping-multiple-angular-2-applications-on-the-same-page/. – Carlos May 22 '17 at 21:22
  • I'm not sure if it is possible for each app to dynamically add an entry to the "packages" object of the System.config, but if it is that would be the way to go. So each portlet would have add it's mapping to the "packages" object and do it's System.import. – Carlos May 22 '17 at 21:37