Muhammad Hassan 5/18/2017

AngularJS: Error – Argument of type ‘RegExp’ is not assignable to parameter of type ‘string’

Read Original

This article explains a common TypeScript error in AngularJS: 'Argument of type 'RegExp' is not assignable to parameter of type 'string''. It occurs when incorrectly initializing a regular expression by passing a RegExp literal to the RegExp constructor. The post provides two correct solutions: using a RegExp literal directly or using the constructor with a string pattern and flags.

AngularJS: Error – Argument of type ‘RegExp’ is not assignable to parameter of type ‘string’

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week