Skip to content

Instantly share code, notes, and snippets.

@hansl
Last active February 1, 2018 00:36
Show Gist options
  • Save hansl/7d3f8c485dc151ed1bdb5fc0d5a8e051 to your computer and use it in GitHub Desktop.
Save hansl/7d3f8c485dc151ed1bdb5fc0d5a8e051 to your computer and use it in GitHub Desktop.
import { Rule, SchematicContext, Tree } from '@angular-devkit/schematics';
// You don't have to export the function as default. You can also have more than one rule factory
// per file.
export function myComponent(options: any): Rule {
return (tree: Tree, _context: SchematicContext) => {
tree.create(options.name || 'hello', 'world');
return tree;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment