Skip to content

Instantly share code, notes, and snippets.

View mrmeku's full-sized avatar
💭
Chillin like a villain

mrmeku

💭
Chillin like a villain
View GitHub Profile
@mrmeku
mrmeku / car.service.ts
Last active May 31, 2018 16:38
Example of how to wrap the output of ts_proto_library to create an Angular Service
import {Http, ResponseContentType} from '@angular/http';
import * as Schema from 'api_schemas_with_bazel/schema/car_ts_proto';
import {bindNodeCallback, Observable} from 'rxjs';
import {toObservableServiceMethod} from './observable-service-method';
export class CarService {
readonly getCars: (request: Schema.GetCarsRequest) => Observable<Schema.GetCarsResponse> =
toObservableServiceMethod(this.createCarServiceForMethod('getCars'), ({getCars}) => getCars);
ng_module(
name = "app",
srcs = glob(
["*.ts"],
exclude = ["*.spec.ts"],
),
assets = [
"app.component.css",
"app.component.html",
],