OfficeDev / Office-Addin-TaskPane-Angular

Template to get start started writing a TaskPane Office Add-in for the Angular framework using TypeScript
Other
13 stars 19 forks source link

Angular binding problem #112

Open stefanofalasca opened 1 year ago

stefanofalasca commented 1 year ago

Expected behavior

Binding data with angular project

Current behavior

Data are not binded from html template, when I run plugin from outlook. If run plugin from localhost: https://localhost:3000/taskpane.html data are binded good.

problem is the same of this https://stackoverflow.com/questions/72761205/angular-outlook-add-in-binding-issue-in-taskpane

my template is this:

<div class="container">
    <table class="table table-fixed table-condensed" *ngIf="customers !== undefined">
        <thead>
        <tr>
            <th scope="col">Ragione Sociale</th>
            <th scope="col">Indirizzo</th>
            <th scope="col">Comune</th>
            <th scope="col">Provincia</th>
        </tr>
        </thead>
        <tbody>
        <tr 
        *ngFor="let customer of customers.value" 
        (click)="onSelect(customer)"
        [ngClass] = "{'table-primary' : customerSelected == customer}"
        >
            <td>{{customer.RagioneSociale1}}</td>
            <td>{{customer.Indirizzo}}</td>
            <td>{{customer.Descrizione}}</td>
            <td>{{customer.Provincia}}</td>
        </tr>
        </tbody>
    </table>

</div>
stefanofalasca commented 1 year ago

Anyone have same problem ?

fredpeaks commented 1 year ago

Yes, same here with a newly generated project. I see "{{welcomeMessage}}" in my taskpane instead of "Welcome"

brynnlow commented 1 year ago

still no solution to this problem?

bubment commented 1 year ago

I'm also waiting for the proper solution but there is a workaround. You can use basic property binding instead of using template text.

For example instead of using

<div>{{ message }}</div>

you can use

<div [innerText]="message"></div>