小编Ram*_*ana的帖子

Http中的JSON输入意外结束从Angular 2获取请求到Codeigniter

Codeigniter Hello World程序的Angular 2运行完美.但是我发送错误"JSON输入的意外结束",同时从Angular 2向Codeigniter Controller发送Http get请求"Entry.php"Plunker代码在此链接:

https://plnkr.co/edit/MHVVkWwFqEggqSI5b6B2?p=info

同样的代码也粘贴在这里:app.module.ts

import { NgModule }            from '@angular/core';
import { BrowserModule }       from '@angular/platform-browser';
import { HttpModule } from "@angular/http";
import { AppComponent }        from './app.component';
import { EntryService }        from './entry.service';

@NgModule({
  imports: [
    BrowserModule,
    HttpModule
  ],
  declarations: [
    AppComponent
  ],
  exports: [ // export for the DemoModule
    AppComponent
  ],
  providers: [ EntryService], 
  bootstrap: [ AppComponent ]
})
export class AppModule { }
Run Code Online (Sandbox Code Playgroud)

app.component.ts

import { Component, OnInit} from '@angular/core';
import { …
Run Code Online (Sandbox Code Playgroud)

json get codeigniter-3 angular

6
推荐指数
2
解决办法
1万
查看次数

标签 统计

angular ×1

codeigniter-3 ×1

get ×1

json ×1