last day (14 days later) » 

12:56 PM
0
A: Transfer table row data to html form page in angular

Immanuel Kirubaharan SAdded ng-include to load different html page in your table page itself and to toggle it on need basis as like example below, In controller: $scope.loadEmployee = function(employee){ $scope.employee=employee; $scope.employee.visible=true; }; $scope.updateEmployee = function(employee) { ...

 
where does it specify that the data(employee) needs to be moved a separate html page (UpdateEmployee.html). It is just hitting a rest service
 
Yes still it is a same html file,you need $scope.employee to populate the update form right?
 
yes but how will clicking a button in my list table redirect me to the update employee page
 
Is your Update form is in separate HTML to get redirected. As per my understanding it is in same HTML file. Am I wrong?
 
yes it's in a separate html file and i want to take the employee data to that separate html file in the same path
 
12:56 PM
Then use ng-include in your template and enable/disable it when you need it by ng-show and ng-hide. I've update my answer Please check and let me know.
 
suggest can you suggest the required code changes pls
 
Please check my answer I've updated.
 
it's showing this error: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
 
It seems this issue because of your API, Please try to test it with some sample JSON and let me know.
 
no, all other apis work absolutely fine. I have cors configured properly in my backend app. it appears there's some problem in moving to that page.
hi
 
12:58 PM
Hi
 
yes i was saying it appears to be some other issue
 
Yeah I just want to know loadEmployee function is there with the same controller or it is in different controller?
 
same controller
 
then you should be able to get the update page on click of edit button in table row
 
i gues ther's some problem in routing
 
1:02 PM
do you have plunkr for this issue?
 
nope
 
can you replicate the issue with plunkr?
 
no
when i click the button, it calls the load method
it sets the employee in the scope
and visible = true
 
have you configure the ng-include tag to your form update html template?
 
no i think
i am new to angular
 
1:06 PM
if you want to redirect your page to the update html then you need separate route for that
do you have separate route for update page?
 
hi
i have been able to do it not
 
$stateProvider
.state('EmplyoeeUpdate', {
templateUrl: "templates/employee-update.html",
controller: 'employeeCtrl'
});
 
i created the form in the div tag itself
and the div appears when the visible is true
thanks Immanuel
appreciate your help
 
is it working now?
great...
 
yes
one more thing
visible attribute that you took in the employee is now being sent as part of the payload
how to stop it from getting sent to the backend on employee updation
thnks tho
bye
 

last day (14 days later) »