Skip to content

Protobuf with Angular 2.0 + asp.net core(webpack) and Typescript #1

@seanishok01

Description

@seanishok01

protobuf.js version: "protobufjs": "^6.6.4",

i am new to protobufjs and planning to implement the protobufjs in Angular 2 project.
I have installed the protobufjs using the "npm install protobufjs --save" inside the Angular 2 project(VS2015).

i have the service below, which sends the request to WebAPI 2.0 service and get the response in protobuf format

getStudentNames(): Observable {
var headers = new Headers();
headers.append('Content-Type', 'application/x-protobuf');
return this.http.get('/api/students', { headers });
}
Get the sample response as below,
↵*����Ram"(�0�↵&����Gopal"

how to decode the response to below model object
//student.model.ts
export class Student
{
name:string;
rollno: number;
}
Please help me by providing some samples with descriptive steps for Get/POST/PUT/Delete request in Angular 2 and typescript.

Any help are really appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions