@if(!$options['attribute'])import { Directive } from '{{ '@angular/core' }}';

{{ '@Directive' }}({
    selector: '{{lcfirst($upperCamelCaseName) }}',
    template: require('./{{ "$name.$type.html" }}'),
    styles: [ require('./{{ "$name.$type.scss" }}') ]
})
export class {{ $upperCamelCaseName }}Directive {
    constructor() {
    }
}
@elseif($options['attribute'])import { Directive } from '{{ '@angular/core' }}';

{{ '@Directive' }}({selector: '[{{ lcfirst($upperCamelCaseName) }}]'})
export class {{ $upperCamelCaseName }}Directive {
    constructor() {
    }
}
@endif
@if(isset($options['attribute']))import { Directive } from '{{ '@angular/core' }}';

{{ '@Directive' }}({
    selector: '{{lcfirst($upperCamelCaseName) }}',
    template: require('./{{ "$name.$type.html" }}'),
    styles: [ require('./{{ "$name.$type.scss" }}') ]
})
export class {{ $upperCamelCaseName }}Directive {
    constructor() {
    }
}
@else import { Directive } from '{{ '@angular/core' }}';

{{ '@Directive' }}({selector: '[{{ lcfirst($upperCamelCaseName) }}]'})
export class {{ $upperCamelCaseName }}Directive {
    constructor() {
    }
}
@endif
Solve " undefined variable options"
Solve " undefined  variable options"

Problem: Undefined variable options .  On command
"php artisan ng:directive name".
Solution : changed  !$options['attribute'] to
isset($options['attribute'])
