Hi, I'm trying to get Angular 1 directives to get processed with angular2now but I'm unable to get them running.
My filter is defined as this
var {SetModule, Filter} = angular2now;
SetModule('App');
@Filter('currencyFilters')
export class CurrencyFilters
{
constructor() {
return function(input) {
var ret=(input)?input.toString().trim().replace(",","."):null;
return parseFloat(ret);
};
}
}
After i make an import through from filter and finally introduce this in html:
but filter is not processed.
And obtain an error: Error: [$injector:unpr] http://errors.angularjs.org/1.3.17/$injector/unpr?p0=currencyFiltersFilterProvider%20%3C-urrencyFiltersFilter
Any hint on how to achieve it?
The example is a bit long, because I just plugged your filter code into something else that I was working on, but if you look for currencyFilters you will find your code.
Hi, I'm trying to get Angular 1 directives to get processed with angular2now but I'm unable to get them running.
My filter is defined as this
var {SetModule, Filter} = angular2now; SetModule('App'); @Filter('currencyFilters') export class CurrencyFilters { constructor() { return function(input) { var ret=(input)?input.toString().trim().replace(",","."):null; return parseFloat(ret); }; } }
After i make an import through from filter and finally introduce this in html:
but filter is not processed. And obtain an error: Error: [$injector:unpr] http://errors.angularjs.org/1.3.17/$injector/unpr?p0=currencyFiltersFilterProvider%20%3C-urrencyFiltersFilter Any hint on how to achieve it?Your filter definition is fine, but have you:
Have a look at the example below, which uses your filter and actually works.
http://jsbin.com/tipeqa/14/edit?html,js,output
The example is a bit long, because I just plugged your filter code into something else that I was working on, but if you look for
currencyFilters
you will find your code.Hopefully the example helps you.
@tinicencio Did my explanation help you?
Closing, as this is not a problem with angular2now.