Working through a custom angular directive