1

I have an application I am trying to set up as a SPA with AngularJS that hooks into a REST API off of our internal SharePoint site. I am having issues with ng-view and getting any of the views to actually load. Both views are setup as ng-template and whenever it tries to find one, it kicks back a 404 Not Found like it's still looking for a separate page.

Here is the plnkr.

I know that none of the data will load because of this coming from an internal SharePoint list, but the views should at least load something to give us an idea of what is going on.

Edit: I cannot actually answer this since my account is too new, but I needed to move the ng-template script blocks inside of the ng-app div so that they would be recognized.

3
  • You should also load jQuery before Angular so Angular can use it. But why even load jQuery? Why not use Angular's $http service like you did in one spot? Commented Mar 18, 2014 at 22:56
  • Indeed you found the correct answer a directive won't be processed if it isn't in the context of the ng-app that has those directives defined (either directly or within module dependencies) Commented Mar 18, 2014 at 23:30
  • @EddieMongeJr - I didn't even notice that it's a bit of both $http and jQuery. Oi, apparently I need either more or less coffee. I'm going to just switch them all over to $http. jQuery is included in our SharePoint site so I had been using that for the ajax calls since I don't have a great deal of experience with Angular. Commented Mar 19, 2014 at 0:05

1 Answer 1

1

Just so that this doesn't stay as unanswered:

I needed to move the ng-template script blocks inside of the ng-app div so that they would be recognized by Angular and not loaded in the wrong order compared to the DOM.

Sign up to request clarification or add additional context in comments.

Comments

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.