In the back office I reference a controller within my Angular resource file but constantly get Not Found (see image 2).
The path is the exact same as other controller references, and they work.
The method IS in the controller.
Every time I add/change anything to do with angular I have to restart the appool (which is an utter pain) and rename EVERY fckn file.
Maybe someone can shed some light cause I am running out of ideas.
(I have changed the path referencing the controller between "umbraco/backoffice/.....etc" and "backoffice/.....etc)
I have ensured the naming remains consistent between angular controller, angular resource and .net controller, ie "getNodeDetails" is used in all three.
In Chrome toolsit indicates the correct path to the controller (see image 1)
Angular Route to .net controller
The following is really doing my head in...
In the back office I reference a controller within my Angular resource file but constantly get Not Found (see image 2).
The path is the exact same as other controller references, and they work. The method IS in the controller. Every time I add/change anything to do with angular I have to restart the appool (which is an utter pain) and rename EVERY fckn file.
Maybe someone can shed some light cause I am running out of ideas.
(I have changed the path referencing the controller between "umbraco/backoffice/.....etc" and "backoffice/.....etc)
I have ensured the naming remains consistent between angular controller, angular resource and .net controller, ie "getNodeDetails" is used in all three.
In Chrome toolsit indicates the correct path to the controller (see image 1)
Hi Stephen
Which class does your .net api controller inherit from ?
UmbracoAuthorizedApiController ?
this effects how the request to your controller is routed:
https://our.umbraco.org/documentation/Reference/Routing/Authorized/
eg: backoffice/api/controllername/actionname
There is a PluginController attribute that if you decorate your controller with, will direct the routing via the specified plugin area name
eg [PluginController("pluginareaname")]
would route via backoffice/pluginareaname/controllername/actionname
not sure if that helps you pinpoint why it is not working ?
regards
marc
Hi marc Yes I am using UmbracoAuthorizedApicontroller and it is decorated as you indicated. In this instance it is decorated as:
so in my resource.js I am referencing:
On my server the file resides in the path:
umbraco/backoffice/TPS/[name of controller.cs]
I thought it may be a caching issue with the server and restarted the app pool then even restarted the server but no change.
One thing to note is that I am nesting references to angular controllers, ie:
Each js controller references a specific resource.js file and subsequently they in turn reference the same .net controller.
The manifest file references all the appropriate controller.js and resource.js files etc.
thanks
Hi Stephen,
I presuming your API is EventApicontroller and method name is getNodeDetails if so, then path should be:
url should be : '/umbraco/api/EventAPI/getNodeDetails/'
hope it will help.
Harshit
Hi Harshit,
your code example is not what I am using. See my response to Marc. thanks
Stephen
couple of thoughts (not sure you have posted the signature of your controller above) but
try passing the nodeid as just a parameter called id ie so, your request is
backoffice/TPS/EventsApi/getNodeDetails/1234
where 1234 is accepted as a parameter called id
Then try switching this parameter to be of type string (if it is currently an integer)
Final suggestion: is are you decorating your controller with [HttpGet] ?
if so make sure it is resolved to System.Web.Http namespace, and not System.Web.Mvc
regards
Marc
Thanks Marc. I'll try this out and get back.
Stephen
is working on a reply...