change resource configuration to use AngularJS $injector, and separate regexpUrl to isolated scope with more intelligence