1

Iam testing Angular Element with SharePoint Framework (SPFX) Webpart, as Andrew Conell has described in his Blog

Every thing is working as asspected, i have added UI-Router in webpart just for testing how it works with Angular Element inside SPFX webpart. And as asspected routing is working, but no data is displayed on the MainComponent (Main page). I have added some test data in main.component.ts as below:

`public data: any[]; public heroes = [ {id: 1, name:'Superman'}, {id: 2, name:'Batman'}, {id: 5, name:'BatGirl'}, {id: 3, name:'Robin'}, {id: 4, name:'Flash'} ]; public test:string;

constructor(){
  let t = "main page...";
  this.test = t;
  this.data = this.heroes;
  console.log(JSON.stringify(this.data));
}

`

And in main.component.html:

<span>{{test}}</span> <table> <thead> <th>Name</th> <th>Index</th> </thead> <tbody> <tr *ngFor="let hero of data"> <td>{{hero.name}}</td> </tr> </tbody> </table>

And if i add same test data in my AppComponent then it works, data in table get displayed and even text string "test" is dislayed...

Here is my solution (SPFXAngularUIRouter) on GITHUB for testing...

I think i have same problom as described here

0

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.