feat($resource): pass resource to the dynamic param function