question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Angular outlook addin not working

See original GitHub issue

Hi,

I have created a new addin project for outlook using Angular, the problem is that the addin is not working after a prod build is done. You can reproduce this error:

  1. Create a addin project with yo
  2. Select outlook w Angular
  3. Add a *ngIf=“false” to any html tag (root div)
  4. Build the project and adapt the manifest pointing to a server where you gonna host the addin (https)
  5. Add the add-in to outlook web
  6. Look at the js console and see the error below

Uncaught Error: Template parse errors: Can't bind to 'ngif' since it isn't a known property of 'main'. ("ontSize-su ms-fontWeight-light ms-fontColor-neutralPrimary">{{welcomeMessage}}</h1> </header> <main [ERROR ->]*ngif=false class=ms-welcome__main> <h2 class="ms-font-xl ms-fontWeight-semilight ms-fontColor-neutra"): ng:///e/e.html@0:323 Property binding ngif not used by any directive on an embedded template. Make sure that the property name is spelled correctly and all directives are listed in the "@NgModule.declarations". ("="ms-fontSize-su ms-fontWeight-light ms-fontColor-neutralPrimary">{{welcomeMessage}}</h1> </header> [ERROR ->]<main *ngif=false class=ms-welcome__main> <h2 class="ms-font-xl ms-fontWeight-semilight ms-fontColor-"): ng:///e/e.html@0:317

It seems that the generator is not working correctly for prod builds - maybe the angular project is not bootstrapped?

best regards Murat

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
sjgarlandcommented, Jan 25, 2020

I had (and resolved) this and another problem that occurred when I created an Excel add-in using Yeoman and added a simple *ngFor in app.component.html. The add-in ran successfully on https://localhost:3000 using npm start, but not over the web when using the dist directory produced by npm run build. Furthermore, the icons in the assets directory did not display properly.

See https://github.com/sjgarland/YoTest for modifications to the generated code that fix these problems.

0reactions
itsdaniellucascommented, Oct 14, 2022

Managed to solve this issue, just need to set minify to false on HtmlWebpackPlugin in webpack.config.js e.g.:

new HtmlWebpackPlugin({
  filename: "taskpane.html",
  template: "./src/taskpane/taskpane.html",
  chunks: ["polyfill", "taskpane"],
  minify: false
})

Works for the following package.json:

{
  "html-loader": "^4.2.0",
  "html-webpack-plugin": "^5.5.0",
  "webpack": "^5.50.0"
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular Outlook add-in Binding issue in Taskpane
I am new to Outlook add-in task pane. Created the add-in using yeoman generator. Default created application working fine with Command.ts ...
Read more >
Develop Office Add-ins with Angular - Microsoft Learn
Use Angular to create an Office Add-in as a single page application. ... Navigating between routes in the application might not work if...
Read more >
An example in Angular - Microsoft Office Add-Ins for ... - LinkedIn
[Lecturer] So I'm back in PowerShell and I'm going to type 'yo office' and remember, one of the options, the first actually, is...
Read more >
Office Add-ins with Visual Studio Code
Once you have your tools installed, you can create a basic add-in for Excel, OneNote, Outlook, PowerPoint, Project, or Word by completing a...
Read more >
Create Microsoft Office Addin using Angular CLI
While I was testing the Outlook addin for the desktop app, it did not load angular components. However, It was working fine in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found