generator-office icon indicating copy to clipboard operation
generator-office copied to clipboard

Angular app lists the directory contents instead of the actual app

Open ricalo opened this issue 11 years ago • 2 comments

When browsing to the root of the app, I see the contents of the root folder. image

However, I think what you're trying to show is something like the following image image

If this is right, you just need to add ng-app and ng-controller directives to index.html

<html ng-app="officeAddin">
...
<body id="container" ng-controller="homeController">

and set directoryListing: false in gulpfile.js

ricalo avatar Oct 08 '15 00:10 ricalo

Actually this won't work reliably. There's a conflict with office.js and angular where the clobber each other on load. Sometimes it works, but other times it doesn't so the safest way to get an angular app loaded is to manually bootstrap it as we do here in a mail addin.

In addition I'd recommend we not use ng-controller because it's deprecated in ng2 and conflicts with most of the accepted style guides.

Back to your question... which type of an addin did you create that was causing this issue?

andrewconnell avatar Oct 10 '15 12:10 andrewconnell

I saw that behavior in task pane and mail apps. It's good to see that you've figured a way to load the app. I'll do some more testing during the week.

ricalo avatar Oct 12 '15 03:10 ricalo