Angular 2: The makeDecorator episode
Miguel Ramos


Great article! I’m looking at doing something similar to this, however when I used your code as a blueprint for starting mine I run into and error when loading the page ‘ Error: Cannot resolve all parameters for ‘Parser’(?). Make sure that all the parameters are decorated with Inject or have valid type annotations and that ‘Parser’ is decorated with Injectable.’

Your example didn’t indicate the ‘imports’ necessary to get this working, but what I’ve done is import these:

import { makeDecorator } from ‘@angular/core/src/util/decorators’;

import ‘reflect-metadata’;

I’ve found that if I do nothing more than add import ‘reflect-metadata’ at the top of any file, without any additional code, I get this same error message. That leads me to believe that I must need to get access to Reflect.getOwnMetadata from some other source?


One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.