@protobuf-ts/runtime-angular
Runtime library for using protobuf-ts with angular.
If you generate code with the protobuf-ts plugin and the enable_angular_annotations
option, you need this package as a dependency.
Provides the following features:
Injection token for RpcTransport
Using the RPC_TRANSPORT
injection token, you can configure aRpcTransport
for
your application.
@NgModule({
declarations: [
AppComponent,
],
imports: [
BrowserModule,
],
providers: [
AllMethodsServiceClient,
{provide: RPC_TRANSPORT, useValue: new TwirpFetchTransport({
baseUrl: "http://localhost:4200"
})},
],
bootstrap: [AppComponent]
})
export class AppModule {
}
Date pipe with support for google.protobuf.Timestamp
The PbDatePipe
works exactly like the original angular DatePipe
,
but also understands google.protobuf.Timestamp
and google.type.DateTime
.
To use PbDatePipe
, add the PbDatePipeModule
to your AppModule
import:
@NgModule({
imports: [
BrowserModule,
FormsModule,
PbDatePipeModule,
],
})
export class AppModule {
}