AngularJS: multiple edit forms routing? -
I have the entry of each request with Request_Type_Id, which maps to a feeder list (which develops as an application It is possible). For example, we have (ID, request type) 1 - sales information, 2 - technical support, 3 - can be order information, and of course, each has unique fields, so editing forms are very different.
By clicking on the name, I want to open these different editing forms right away.
For routing, I have this:
$ routeProvider When ('/ editrequest /: Req_id /: id', {controller: 'editRequestController', templateUrl: '/App/Views/editRequest.html'}). Otherwise ({redirectTo: '/'}); Because I
& lt; A href = "# / edit / {{req.request_Id}} / {{req. Id}}" & gt; {{Req.title}} & lt; / A & gt; I am still trying to learn AngularJS and wondering if the best way to go from here is to choose the correct editing form on app / views / edit request.html For ng- showing This would mean that there will be at least 3 forms on that template (although not nested), which may be a problem in some browsers.
Is there any more angular JS method that I have not yet learned to do?
Thanks in advance!
templateUrl can be a string or function , Which passes the path parameter and returns the string. In your case, you can:
$ route provider. When to generate a url return '/ app / view / edit' + parameter ('/ editrequest /: req_id /: id', {controller: 'editRequestController', templateUrl: function (parameters) {// use params. Req_id) .req_id + '. Html ';}}). Otherwise ({redirectTo: '/'}); There is another important thing worth mentioning here, be careful when using the Interpolate in href or src . Use or instead of
Comments
Post a Comment