Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save tuanngominh/025c1e0f6f290ed194aa257019257997 to your computer and use it in GitHub Desktop.

Select an option

Save tuanngominh/025c1e0f6f290ed194aa257019257997 to your computer and use it in GitHub Desktop.
Pragmatic solution for sharing type between angular and firebase cloud function
// cloud function
import {type1} from `../../feature1`; //relative import
// angular
import {type1} from `@app/shared/feature1`
// angular's tsconfig.json
{
"compilerOptions": {
"paths": {
"@app/shared": ["../../shared"]
}
}
}
// folder layout
/*
cloud-functions
angular
shared
feature1
type1.ts
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment