This is an Angular2 Component Files Generator


To install this package globally you only need to do:

pub global activate ng2gen

this will download and install ng2gen_component executable into ~/.pub-cache/bin


To execute the generator you only need to do this:

cd path/to/generate/component
pub global run ng2gen:component my_component

or you can also add ~/.pub-cache/bin to your class path and do:

cd path/to/generate/component
ng2gen_component my_component

this should generate next files structure:

  └─ my_component
       ├─ my_component.dart
       └─ my_component.html

where my_component.dart contains:

// Copyright (c) 2016, <your name>. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

import 'package:angular2/angular2.dart';

  selector: 'my-component',
  templateUrl: 'my_component.html')
class MyComponent {


and my_component.html will be empty.