Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(generate): add directives #149

Merged
merged 2 commits into from
Jan 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,20 @@ Navigate to `[http://localhost:4200/]`. The app will automatically reload if you

### Generating other scaffolds

Add a new component with:
```bash
ng generate component my-new-component
```
You can use the `ng generate` (or just `ng g`) command to generate Angular components:

Add a new service with:
```bash
ng generate service my-new-service
```

Add a new pipe with:
```bash
ng generate pipe my-new-pipe
ng generate component my-new-component
ng g component my-new-component # using the alias
```
You can find all possible blueprints in the table below:

Scaffold | Usage
--- | ---
Component | `ng g component my-new-component`
Directive | `ng g directive my-new-directive`
Pipe | `ng g pipe my-new-pipe`
Service | `ng g service my-new-service`


### Creating a build
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import {
it,
iit,
describe,
ddescribe,
expect,
inject,
injectAsync,
TestComponentBuilder,
beforeEachProviders
} from 'angular2/testing';
import {provide, Component} from 'angular2/core';
import {<%= classifiedModuleName %>} from './<%= dasherizedModuleName %>';


@Component({
selector: 'test-component',
template: `<div <%= dasherizedModuleName %></div>`
})
class TestComponent {}

describe('<%= classifiedModuleName %> Directive', () => {

beforeEachProviders(() => []);


it('should ...', injectAsync([TestComponentBuilder], (tcb:TestComponentBuilder) => {
return tcb.createAsync(TestComponent).then((fixture) => {
fixture.detectChanges();
});
}));

});
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {Directive} from 'angular2/core';


@Directive({
selector: '<%= dasherizedModuleName %>',
providers: [],
host: {},

})
export class <%= classifiedModuleName %> {

constructor() {}

}