我们如何将结果数据从CodeIgniter控制器传递到AngularJS控制器? [英] How can we pass result data from CodeIgniter controller to AngularJS controller?

查看:102
本文介绍了我们如何将结果数据从CodeIgniter控制器传递到AngularJS控制器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将结果数据从CodeIgniter控制器传递到AngularJS控制器?在使用jsonSuccess代码的CodeIgniter控制器中,我要将数据传递给AngularJS,但我想传递不同的3个变量

How can we pass result data from CodeIgniter controller to AngularJS controller? In CodeIgniter controller using jsonSuccess code here I'm passing data to AngularJS but I would like to pass different 3 variables

我需要如何传递它们以及如何获取数据?

How do I need to pass them and how can I get data?

codeigniter控制器代码:

codeigniter controller code:

$siteName   =   $CI->config->item('siteName');
 $siteURL   = site_url();


        if($data['status'] == 'success')

        {


            $result =   $this->LowCredit_model->info($data['data']);

            jsonSuccess($result,$siteName ,$siteURL,$result['succ_code'],$siteName,$siteURL);

        }

Angular控制器代码:

Angular Controller code:

$scope.init     =   function() {


        alert('init');

            gdiztunnel.post( 

            'order/LowCredit', {

               id: $configId 
            }

        ).then(

                function success (response) {

                    response    =   response.data;

                    if(response.status  ==  'success') {

                        $scope.lowcreditCtrl.data = response.data;

推荐答案

我已经为您提供了解决方案,这是重复问题

I already gave you the solution this is Repeated Question

$data['siteName']   =   $CI->config->item('siteName');
$data['siteURL']   = site_url();
 if($data['status'] == 'success') {
   $data['result'] =   $this->LowCredit_model->info($data['data']);
   jsonSuccess($data);
 }

这篇关于我们如何将结果数据从CodeIgniter控制器传递到AngularJS控制器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆