Open tennisgent opened 9 years ago
Yeah, that looks good. Or something like:
var directive = quickmock({
providerName: 'myDirective',
moduleName: 'myModule',
scope: POJOWithPropertiesThatAreMappedOntoScope,
html: '<div my-directive some-property="key"></div>'
});
directive.$compile();
Oh okay. I see. Just do like a angular.extend(newScope, configScope)
to merge all the properties from the config scope value onto the scope that is created by quickmock. I think I'll add both ways of doing it :)
.$scope
needs to be added to the directive object whenquickmock()
is initially called, rather than during the.$compile()
phase, so that the scope properties can be modified before the compile happens.Right now this requires a dummy call to
.$compile()
so that the.$scope
first shows up:What we need is the ability to do this: