angularJs directive prototype