Angular2 create custom Pipes with import problems

With angular2 RC.1 we created a custom Pipe and import some classes we need to create the pipe. Only now we migrate to final angular release and we are not able to import any of the classes we need.

import { isBlank, isString, isArray, StringWrapper, CONST } from 'angular2/src/facade/lang';
import { BaseException } from 'angular2/src/facade/exceptions';
import { ListWrapper } from 'angular2/src/facade/collection';
import { InvalidPipeArgumentException } from 'angular2/src/common/pipes/invalid_pipe_argument_exception';

Can someone tell us where we can found this classes, we are not able to find them, also not in the code. So what is happening with all them?


ANSWERS:


These were all refactored out of the public API purposefully around the RC6 timeframe, if I remember right. If you go through the source code on github you'll see that in most cases these exist but are no longer exported anywhere. There is a github issue going back to April of 2015 which highlights the thinking behind removing these internal utilities from public exposure:

Facades are here to abstract JS / Dart differences. We don't want to be in business of providing general helper functions as there are already plenty of libraries that do just that in a generic manner. Facades are minimal and for internal use - we don't want to grow those to sth generic as not to add too many bytes to the framework.

You'll either need to find libraries that implement what you need or build your own out.

isString, for example is a straightforward typeof: Check if a variable is a string

isBlank can be accomplished by checking if it's a string and then seeing if the thing is blank with a regex.

Exceptions would be derived from error: How do I extend a host object (e.g. Error) in TypeScript where you throw the new error.

You asked what happened to them, and I answered.



 MORE:


 ? how to show only the arrays that contain object?
 ? How to Detect Signs "?" In a URL
 ? After Effects Javascript search and change name of Comp
 ? Find information from an array using another array
 ? Find substring with specific string pattern in php
 ? JQuery - search elements values with given regex
 ? How to find exact substring inside a string using javascript
 ? How do I check whether a character in a string is a specific character in JavaScript?
 ? Extract a specific word from string in Javascript
 ? How to iterate over each element with a class name