0

This is in a SharePoint online environment.

I have created a publishing page in a pages library in a sub site. On this page, I have dropped a content editor web part which points to an aspx page in a style library at the site collection level. This aspx page is from a simple angular application that renders content. It will eventually be expanded to do more. Once I do this, I click apply or ok on the content editor web part and my angular app renders properly on the publishing page. So far, so good.

Now on top of the page in the ribbon, if I save or check in, I get a page not found error. In the URL for the error page, the request it cannot find is wrong. Somehow, this request is getting malformed along the way.

My aspx page for my angular app exists here - https://sitecolletionname/Style%20Library/Scripts/ngApp/index.aspx

My publishing page that I'm building is here - https://sitecollectionname/subsite1/Pages/ngAppTest.aspx

When I save or check in, I see this in the page not found url - https://sitecollectionname/Pages/PageNotFoundError.aspx?requestUrl=https://sitecollectionname/style%20library/scripts/ngApp/ngAppTest.aspx

As you can see in the requestUrl querystring parameter, it's trying to render a page which truly does not exist. It takes the url of the aspx page to my angular app and changes the name to the actual publishing page.

At this point, I have to check in the page from the default view of the pages library. However, if I try to do any more editing on the page, I end up on the page not found page. So essentially, I cannot use the page any more.

Any ideas?

Thanks

8
  • can you share your app-routing.module.ts file to understand better
    – Sunil Sahu
    Sep 26, 2018 at 9:09
  • Hi Sunil. I don't have an app-routing.module.ts file, only a app.module.ts file. It's a single page app that's going to interact with a web api. Would that file help you? Sorry, I'm a bit new to the angular world.
    – Cosmo Dev
    Sep 27, 2018 at 12:27
  • share that file
    – Sunil Sahu
    Sep 27, 2018 at 12:31
  • Here is the code - pastebin.com/iTwsqMKY Thanks
    – Cosmo Dev
    Sep 27, 2018 at 12:47
  • what is the <base href=""> in your application index.html
    – Sunil Sahu
    Sep 27, 2018 at 14:00

1 Answer 1

0

For handle refresh in angular you need to configure route for handling.

you can refer the article for configure routes

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.