Same, it doesn’t matter whether the backend is node or not, you just need to use angular’s $http service to send an ajax request; the backend will handle it. In addition, angular also supports using $resource to interact with RESTful server data sources
Node is on the server side and is responsible for providing API; Angular is on the client side and uses the $http service to send ajax requests and interact with the API for data
This problem has nothing to do with nodejs;
How to interact with data in a non-nodejs environment is the same under nodejs. It is transparent to your front end (angularjs implementation)
I have a similar problem! It’s no problem to get it through angular, this is pull mode! You configure app.get render in app.js to index.html and use $http.get() to get it. I should have sent two requests!
If you bring the required data to the controller in node render, you don’t need to send an asynchronous request!
Is that so? The following code was found online
// employeeService.queryData(function(data) {
// var v = _.clone(mapping.employeeList);
// v.list = data;
// console.log( v );
// console.log( "==============" );
// res.render(mapping.employeeList.view, v);
// });
employeeService 是什么鬼但不到!
https://github.com/btford/angular-express-seed
Same, it doesn’t matter whether the backend is node or not, you just need to use angular’s
$http
service to send an ajax request; the backend will handle it. In addition, angular also supports using$resource
to interact with RESTful server data sourcesIt seems to be using the $http command in angulajs
Node is on the server side and is responsible for providing API; Angular is on the client side and uses the $http service to send ajax requests and interact with the API for data
XXX interacts with angularjs data
The answer should be the same
Usually use $http or $resource of angularjs to obtain
In fact, the main idea is to use ajax requests to process the data returned after success or failure.
In angular, you can use the $http.get() method:
This problem has nothing to do with nodejs;
How to interact with data in a non-nodejs environment is the same under nodejs. It is transparent to your front end (angularjs implementation)
I have a similar problem!
It’s no problem to get it through angular, this is pull mode!
You configure app.get render in app.js to index.html and use $http.get() to get it. I should have sent two requests!
If you bring the required data to the controller in node render, you don’t need to send an asynchronous request!
Is that so?
The following code was found online