Angular outlook addin not working
See original GitHub issueHi,
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:
- Create a addin project with yo
- Select outlook w Angular
- Add a *ngIf=“false” to any html tag (root div)
- Build the project and adapt the manifest pointing to a server where you gonna host the addin (https)
- Add the add-in to outlook web
- 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:
- Created 4 years ago
- Reactions:2
- Comments:8 (1 by maintainers)
I had (and resolved) this and another problem that occurred when I created an Excel add-in using Yeoman and added a simple
*ngFor
inapp.component.html
. The add-in ran successfully on https://localhost:3000 usingnpm start
, but not over the web when using thedist
directory produced bynpm run build
. Furthermore, the icons in theassets
directory did not display properly.See https://github.com/sjgarland/YoTest for modifications to the generated code that fix these problems.
Managed to solve this issue, just need to set
minify
tofalse
onHtmlWebpackPlugin
inwebpack.config.js
e.g.:Works for the following
package.json
: