Fixed JS code after JSHint 'advices' and enforced a 4-spaces indent style for the directive