gen/writers/generate.go
func GenerateAngular(descriptor *gen.APIDescriptor, pkgDir string) ([]string, error) {
	var files []string
	for _, name := range descriptor.ResourceNames {
		res := descriptor.Resources[name]
		codegen := filepath.Join(pkgDir, inflect.Underscore(name)+".js")
		f, err := os.Create(codegen)
		if err != nil {
			return files, err
		}
		c, err := NewAngularWriter()
		if err != nil {
			return files, err
		}
		kingpin.FatalIfError(c.WriteResource(res, f), "")
		f.Close()
		files = append(files, codegen)
	}
	return files, nil
}
func GenerateAngular(descriptor *gen.APIDescriptor, pkgDir string) ([]string, error) {
	var files []string
	for _, name := range descriptor.ResourceNames {
		res := descriptor.Resources[name]
		codegen := filepath.Join(pkgDir, inflect.Underscore(name)+".js")
		f, err := os.Create(codegen)
		if err != nil {
			return files, err
		}
		c, err := NewAngularWriter()
		if err != nil {
			return files, err
		}
		kingpin.FatalIfError(c.WriteResource(res, f), "")
		f.Close()
		files = append(files, codegen)
	}
	return files, nil
}
// Generate API metadata, drives the metadata writer.