@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
@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
--- 
+++ 
@@ -1,4 +1,4 @@
-@if(!$options['attribute'])import { Directive } from '{{ '@angular/core' }}';
+@if(isset($options['attribute']))import { Directive } from '{{ '@angular/core' }}';
 
 {{ '@Directive' }}({
     selector: '{{lcfirst($upperCamelCaseName) }}',
@@ -9,7 +9,7 @@
     constructor() {
     }
 }
-@elseif($options['attribute'])import { Directive } from '{{ '@angular/core' }}';
+@else import { Directive } from '{{ '@angular/core' }}';
 
 {{ '@Directive' }}({selector: '[{{ lcfirst($upperCamelCaseName) }}]'})
 export class {{ $upperCamelCaseName }}Directive {
Solve " undefined  variable options"

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