0

using angular2 beta 12, in Firefox I get the following error:

EXCEPTION: Error: Uncaught (in promise): TypeError: pipe is undefined angular2.dev.js:23730:9

STACKTRACE: angular2.dev.js:23730:9

resolvePromise@http://localhost:2068/node_modules/angular2/bundles/angular2-polyfills.js:543:32
makeResolver/<@http://localhost:2068/node_modules/angular2/bundles/angular2-polyfills.js:520:14
Zone</ZoneDelegate</ZoneDelegate.prototype.invoke@http://localhost:2068/node_modules/angular2/bundles/angular2-polyfills.js:332:20
NgZoneImpl/this.inner<.onInvoke@http://localhost:2068/node_modules/angular2/bundles/angular2.dev.js:2216:22
Zone</ZoneDelegate</ZoneDelegate.prototype.invoke@http://localhost:2068/node_modules/angular2/bundles/angular2-polyfills.js:331:20
Zone</Zone</Zone.prototype.run@http://localhost:2068/node_modules/angular2/bundles/angular2-polyfills.js:227:25
scheduleResolveOrReject/<@http://localhost:2068/node_modules/angular2/bundles/angular2-polyfills.js:576:53
Zone</ZoneDelegate</ZoneDelegate.prototype.invokeTask@http://localhost:2068/node_modules/angular2/bundles/angular2-polyfills.js:365:24
NgZoneImpl/this.inner<.onInvokeTask@http://localhost:2068/node_modules/angular2/bundles/angular2.dev.js:2208:22
Zone</ZoneDelegate</ZoneDelegate.prototype.invokeTask@http://localhost:2068/node_modules/angular2/bundles/angular2-polyfills.js:364:24
Zone</Zone</Zone.prototype.runTask@http://localhost:2068/node_modules/angular2/bundles/angular2-polyfills.js:263:29
drainMicroTaskQueue@http://localhost:2068/node_modules/angular2/bundles/angular2-polyfills.js:482:26
ZoneTask/this.invoke@http://localhost:2068/node_modules/angular2/bundles/angular2-polyfills.js:434:22

It is not related to my code, so I think it is an angular bug. It is a know isseu? Is there a workaround?

I never declared a pipe variable, I'm just using a custom pipe:

import {Pipe, PipeTransform} from 'angular2/core';

@Pipe({
    name: 'myfilter',
    pure: false
})
export class MyFilterPipe implements PipeTransform 
{
    static _string:string = "string";

    transform (value:any[], [queryString]) 
    {     
        if (!queryString || queryString === '')
            return value;

        return value.filter (item => 
        {
            if (typeof item === MyFilterPipe._string)
            {
                return item.toLowerCase().indexOf (queryString.toLowerCase()) > -1;
            }

            for (var propertyName in item) {
                var propertyValue = item [propertyName];

                if (!propertyValue)
                    continue;

                if ((propertyValue + '').toLowerCase().indexOf (queryString.toLowerCase()) > -1)
                    return true;
            }
            return false;
        });
    }
}

It works on Chrome, Safari, Edge Thanks a lot

br.julien
  • 3,420
  • 2
  • 23
  • 44
user3471528
  • 3,013
  • 6
  • 36
  • 60

0 Answers0