c - 如何通信 AngularJS 的 $http 路由和用 C 编程开发的 API

标签 c angularjs angularjs-factory angularjs-http

我使用 AngularJS、Bootstrap、HTML、CSS 制作了 Web 应用程序 GUI。 后端团队正在用 C 编程开发 API。

那么我的 $http 请求(从工厂发送)中的路由将如何与 C 编程 API( Controller )通信以获取数据或执行相关操作。

谢谢!

最佳答案

您只需要 URI,异步请求将如下所示:

    $http.get('URI goes here').then(
            function (response) {
                //success
                vm.data = response;
            },
            function (response) {
                //fail
                console.log("error");
            }
        );

关于c - 如何通信 AngularJS 的 $http 路由和用 C 编程开发的 API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37850329/

相关文章:

javascript - 如何在 AngularJS 上放置服务?

C - 将 2 个 2D 字符串数组组合并更改为更大的 2D 数组的最简单方法

c - 将文本文件中的单词读取到二维数组中的问题

javascript - Angular.js : Initializing a controller on an asynchronously loaded template?

javascript - Angularjs 验证为 true 后,进行普通表单提交

javascript - 无法存储使用 Angular.js UI Router 构建的多步骤表单的数据

c - 无效的目的*

c - 在c中的windows中创建文件夹的日期

javascript - 使用 ng-view 时,AngularJS document.ready 不起作用

javascript - 当工厂可以做同样的事情时,为什么要使用 $rootScope 在 Controller 之间共享数据?