<commit_before>import {Component} from 'angular2/core';

@Component({
    selector: 'my-structural-directives',
    template: `
        <section class="directive">
            <h2>*ngIf</h2>
            <div>
                Enter a number higher than 10
                <br>
                <input type="input" #number (keyup)="0">
            </div>
            <div *ngIf=" number.value > 10">
                Number is greater than 10
            </div>
        </section>
        <section class="directive">
            <h2>*ngFor</h2>
            <div>
                <ul>
                    <li *ngFor="#car of list #i = index">{{car}} {{i}}</li>
                </ul>
            </div>
        </section>
        <section class="directive">
            <h2>[ngSwitch]</h2>
            <div>
                Enter red, blue or green
                <br>
                <br>
                <input type="text" #colour (keyup)="0">
            </div>
            <div [ngSwitch]="colour.value" *ngIf="colour.value != ''">
                <template [ngSwitchWhen]="'red'"><span style="color: red"><br>Colour is red</span></template>
                <template [ngSwitchWhen]="'blue'"><span style="color: blue"><br>Colour is blue</span></template>
                <template [ngSwitchWhen]="'green'"><span style="color: green"><br>Colour is green</span></template>
                <template ngSwitchDefault><span><br>Don't know the colour</span></template>
            </div>

        </section>
    `
})

export class StructuralDirectives {
    list = ['Mazda', 'Honda', 'Mitsubishi', 'Subaru', 'Toyota'];
}
<commit_msg>We created another section which is used to show our custom directive, UnlessDirective.<commit_after>import {Component} from 'angular2/core';
import {UnlessDirective} from "./unless.directive";

@Component({
    selector: 'my-structural-directives',
    template: `
        <section class="directive">
            <h2>*ngIf</h2>
            <div>
                Enter a number higher than 10
                <br>
                <input type="input" #number (keyup)="0">
            </div>
            <div *ngIf=" number.value > 10">
                Number is greater than 10
            </div>
        </section>
        <section class="directive">
            <h2>*ngFor</h2>
            <div>
                <ul>
                    <li *ngFor="#car of list #i = index">{{car}} {{i}}</li>
                </ul>
            </div>
        </section>
        <section class="directive">
            <h2>[ngSwitch]</h2>
            <div>
                Enter red, blue or green
                <br>
                <br>
                <input type="text" #colour (keyup)="0">
            </div>
            <div [ngSwitch]="colour.value" *ngIf="colour.value != ''">
                <template [ngSwitchWhen]="'red'"><span style="color: red"><br>Colour is red</span></template>
                <template [ngSwitchWhen]="'blue'"><span style="color: blue"><br>Colour is blue</span></template>
                <template [ngSwitchWhen]="'green'"><span style="color: green"><br>Colour is green</span></template>
                <template ngSwitchDefault><span><br>Don't know the colour</span></template>
            </div>
        </section>
        <section class="directive">
            <h2>Custom Directive: *myUnless</h2>
            <div>
                Enter true or false
                <br>
                <input type="text" #condition (keyup)="0">
            </div>
            <div *myUnless="condition.value != 'false'">
                Only shown if 'false' was entered
            </div>
        </section>
    `,
    directives:[UnlessDirective]
})

export class StructuralDirectives {
    list = ['Mazda', 'Honda', 'Mitsubishi', 'Subaru', 'Toyota'];
}

{'fraction_non_alphanumeric': 0.15788086452293093, 'fraction_numerical': 0.008697944122298365, 'mean_word_length': 1.6876770538243626, 'pattern_counts': {'":': 0, '<': 115, '<?xml version=': 0, '>': 117, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2541832', 'n_tokens_mistral': 1144, 'n_tokens_neox': 1065, 'n_words': 250}