本文介绍了如何在anguarjs中连接REST API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用mongodb和nodejs并创建REST API(例如http:// localhost:3000 / Records)但现在我想将此API连接到angularjs应用程序。 我尝试过: CREATED rest API方法如HTTP:// LOCALHOST:3000 / DETAILS。
I used mongodb and nodejs and create REST API(for example "localhost:3000/Records") but now i want to connect this API to angularjs application. What I have tried: CREATED rest API METHODS LIKE HTTP://LOCALHOST:3000/DETAILS.
推荐答案要从角度访问其余的API,在控制器内部,无论你的应用程序的任何部分正在访问它,你都需要使用 To access a rest API from angular, inside your controller for whatever portion of your app is accessing it, you'll need to use
http.get来访问它。 http.get to access it. app.controller("YourNameForController", ['
scope',' scope', '
更多推荐
如何在anguarjs中连接REST API
发布评论