Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add Angular? #29

Open
HelloooJoe opened this issue Oct 30, 2023 · 2 comments
Open

How to add Angular? #29

HelloooJoe opened this issue Oct 30, 2023 · 2 comments

Comments

@HelloooJoe
Copy link

I'm new to MAUI but proficient in Angular. I need to access USB, Bluetooth, and NFC. I want to take my existing Angular project and add it to the resources/Raw folder. Can you guide me on how to get Angular running with MAUI. Do I need to run the ng server before I debug? I'll figure it out but maybe you have the answer already. Thanks.

@sibiren-spins
Copy link

What have you already tried? This issue implies that the main repo's code can't access external resources (although if you want to use the fork in that issue, you should be able to point it at your angular dev server), so with the main repo you would probably need to actually build your app with some subdirectory of Resources/Raw as the target in order to run it.

@HelloooJoe
Copy link
Author

HelloooJoe commented Nov 7, 2023

@sibiren-spins Thanks for mentioning that link. I was able to get the Angular app bundled as a microfrontend using what I learned here: https://blog.bitsrc.io/diving-deep-into-angular-elements-c17a868d6894

However, now the issue I am facing is the inability to route from one component to another. I'm guessing it's how the web element was created:

`export class ElementModule implements DoBootstrap {

  constructor(private injector: Injector) {
  }

  ngDoBootstrap(appRef: ApplicationRef) {
    if (!customElements.get('home-mfe')) {
      const homeComponent = createCustomElement(HomeComponent, {
        injector: this.injector
      });
      customElements.define('home-mfe', homeComponent);
    }
  }
}

`

but so far so good, I'm able to communicate from Angular to C#. I just need to figure out what I am doing wrong to communicate the other way around - C# to Angular.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants