Custom validation directive using ng messages and typescript
问题 I'm trying to build a module that has directive for custom validations and showing them using ng-messages The validations are done via regex. The error I am seeing is : Error: [$compile:ctreq] Controller 'ngMessages', required by directive 'ngMessage', can't be found! My code looks like this: Validation directive: module LoginModule { 'use strict'; /***** REGEX *****/ export class regExp { public ID_OR_PASSPORT = /^[0-9]{9}$/; public USERNAME_SINGLE_WORD = /^[A-Za-z0-9à-ú-_\.]{6,8}$/; public