i using asp.net mvc 4 .cshtml view page develop angularjs codes. on .cshtml page, using $resource object. however, when define angular factory using $resource , default parameters @ symbol, asp.net mvc engine in vs editor keeps saying compiling error "@userid not exist in context.". obviously, there ambiguity of @ symbol used razor context , angular context.
how can specify @ symbol used angular , rid of razor engine error compile message? thank you.
i can use .html extension file view page, want use .net mvc .cshtml extension file not lose advantages of razor engine , visual studio ide tool (such intellisense, c# server side codes inside .cshtml page, etc).
here codes in js:
<script type="text/javascript"> var myapp = angular.module("listpeoplemodule", ["ngresource"]); myapp.factory("peoplefactory", function ($resource) { return $resource('../api/getpeopleapi/getpeoplebypage/:userid/:sortcolumnname', { userid: "@userid", sortcolumnname: "@sortcolumnname" } , { update: { method: 'put'} }); }); </script>
Comments
Post a Comment