improved directive in Karma example