Skip to content

Commit 8ba6e93

Browse files
crisbetodevversion
authored andcommitted
feat: angular 4 compatibility
* Bumps the required Angular version to 4 and TypeScript to 2.1.6. * Fixes deprecation warnings for `<template>` usages. * Fixes any unit and e2e test failures. * Includes the new animations module and switches any components that use animations to it. * Fixes issues with the various test apps.
1 parent 9c4f43c commit 8ba6e93

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/lib/input/input-container.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,3 +775,16 @@ class MdTextareaWithBindings {
775775
template: `<md-input-container><input></md-input-container>`
776776
})
777777
class MdInputContainerMissingMdInputTestController {}
778+
779+
/**
780+
* Gets a RegExp used to detect an angular wrapped error message.
781+
* See https://github.com/angular/angular/issues/8348
782+
*/
783+
const angularWrappedErrorMessage = (e: Error) =>
784+
new RegExp(`${regexpEscape(e.message)}$`);
785+
786+
/**
787+
* Escape a string for use inside a RegExp.
788+
* Based on https://github.com/sindresorhus/escape-string-regex
789+
*/
790+
const regexpEscape = (s: string) => s.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');

0 commit comments

Comments
 (0)