Capture the dir property

/to @bajtos 

See https://github.com/strongloop/generator-loopback/issues/66
Actually you don't need `self` as the method is already bound to `this`.