added support for cap parameter to servlet
inner directive listens for changes in element size and invokes parent callback