Xd Plugin using Angular

Is anybody writing plugin using angular?

Try using it in XD plugin just like react is used (https://github.com/AdobeXD/plugin-samples/tree/master/quick-start-react). You might have to add a shim…

I mean I’m already writing plugin with angular, just curious if i’m the only one :slight_smile:

I don’t think you’re the only one trying to use Angular, but I don’t think there’s been any published in the Plugin Manager that use it … AFAIK, anyway.

What version of Angular are you using? Any tips on getting it to work?

I’m trying to use Angular 7.2 (which is the latest one). Really not much tricks for now (as development is not finished yet).
I use ngx-build-plus to extend default webpack. I added webpack.extra.js with following config:
module.exports = { externals:{ scenegraph: "commonjs scenegraph", uxp: "commonjs uxp" } } for correct xd packages import.
Also I had to override PlatformLocation with empty stub to use routes without history api and window.location object.
And of course replace other required window objects with empty stubs like following:
window.HTMLMediaElement = {};
window.HTMLFrameSetElement = {};
window.HTMLBodyElement = {};
window.HTMLFrameElement = {};
These minimal configurations let me build and run plugin. Without watch and auto refresh for now but it works :slight_smile:

3 Likes

I’m trying to get my plugin working using Angular, but haven’t had much success. Did you follow a guide to get it working?

What guide? I’m using angular 7 and it works (with limitations but in general works :slight_smile: ). You can try this one https://github.com/sympli/xd-angular-select-test as something to start with.

2 Likes

Thank you, i will look into that.

I’m bumping this thread up because I now have at least two developers who are using Angular and are curious about Angular in UXP.

@JohnMore wants to know:

Angular or Angularjs?

Another CEP dev says:

… we rely completely on Angular (latest version), and it would be impossible to migrate this to React or another UI framework.

So I’m curious if you’re using Angular or AngularJS, @gdreyv? (Or any other Angular users out there.)

1 Like

Hi, glad to see that I’m not the only one :slight_smile:
We are using Angular 7 (https://angular.io/) and you can try sample tiny project to check how it works: https://github.com/sympli/xd-angular-select-test
The tricky part for me was that I didn’t find the way how to use kind of ‘serve’ while development. So I have to run build (check readme in repository) and replace files in plugins folder.
Please let me know if you have any questions, I’ll be happy to help :slight_smile: