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

Outdated cli and type declarations #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion add-items.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Add the following line inside the `InputButtonUnitComponent` Class, which define
{% code-tabs %}
{% code-tabs-item title="src/app/input-button-unit.component.ts" %}
```typescript
@Output() submit: EventEmitter<string> = new EventEmitter();
@Output() submit = new EventEmitter<string>();
```
{% endcode-tabs-item %}
{% endcode-tabs %}
Expand Down
4 changes: 2 additions & 2 deletions adding-a-checkbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ When we click on the checkbox, it will run the `completeItem` method. Let's talk
```javascript
export class TodoItemComponent implements OnInit {
@Input() item: TodoItem;
@Output() remove: EventEmitter<TodoItem> = new EventEmitter();
@Output() update: EventEmitter<any> = new EventEmitter();
@Output() remove = new EventEmitter<TodoItem>();
@Output() update = new EventEmitter<any>();

// put this method below ngOnInit
completeItem() {
Expand Down
4 changes: 2 additions & 2 deletions component.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,14 @@ At this point you can delete the file `app.component.html`.

**We recommend continuing this tutorial using inline templates in the components.** Especially if you're working on a laptop with a small screen, where there isn't enough space to open two files side-by-side.

Let's configure the Angular CLI to give us inline-template as a default. In the terminal run the command: `ng set defaults.component.inlineTemplate true` (or `ng config schematics.@schematics/angular.component.inlineTemplate true` in Angular cli v6+)`. Now every component that you'll generate will have an inline template, and an HTML file will not be created.
Let's configure the Angular CLI to give us inline-template as a default. In the terminal run the command: `ng config schematics.@schematics/angular.component.inlineTemplate true` (or `ng config schematics.@schematics/angular.component.inlineTemplate true` in Angular cli v6+)`. Now every component that you'll generate will have an inline template, and an HTML file will not be created.

If you wish to continue this tutorial with templates in separate HTML files, do not run this command, and use the generated `.html` files for the templates.

> **Note:** You can specify that you'd like to use inline-template throughout the project in several ways:
>
> * When generating a project, pass the flag `-it` or `--inline-template` like this: `ng new todo-list -it`
> * After generating a project, add it to the configuration so that components generated from this point on will have an inline template: `ng set defaults.component.inlineTemplate true`. \(From version 6 you'll need to use the command `ng config projects.YOURPROJECTNAME.schematics.@schematics/angular:component.inlineTemplate true` instead\) This adds the line `inlineTemplate: true` in the Angular CLI configuration file `.angular-cli.json` \(`angular.json` from version 6\). You can also edit the file directly.
> * After generating a project, add it to the configuration so that components generated from this point on will have an inline template: `ng config schematics.@schematics/angular.component.inlineTemplate true`. \(From version 6 you'll need to use the command `ng config projects.YOURPROJECTNAME.schematics.@schematics/angular:component.inlineTemplate true` instead\) This adds the line `inlineTemplate: true` in the Angular CLI configuration file `.angular-cli.json` \(`angular.json` from version 6\). You can also edit the file directly.
> * If you haven't configured to have inline templates as a default, you can specify this per component when you generate it, by passing the flag `-it` or `--inline-template`. For example: `ng generate header -it`.

The same way we use inline template, we can use also inline styles. But for now we will keep the styles in a separate file.
Expand Down
2 changes: 1 addition & 1 deletion remove-item.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Add a new output to the `TodoItemComponent` class, which will emit the removed i
{% code-tabs %}
{% code-tabs-item title="src/app/todo-item/todo-item.component.ts" %}
```typescript
@Output() remove: EventEmitter<TodoItem> = new EventEmitter();
@Output() remove = new EventEmitter<TodoItem>();
```
{% endcode-tabs-item %}
{% endcode-tabs %}
Expand Down