Closed mapkuff closed 7 years ago
function isolateAllSinks<So, Si>(sources: So, sinks: Si, scope: string): Si {
const scopedSinks = <Si> {};
for (let key in sinks) {
if (sinks.hasOwnProperty(key)
&& sources[key]
&& typeof sources[key].isolateSink === `function`) {
scopedSinks[key] = sources[key].isolateSink(sinks[key], scope);
} else if (sinks.hasOwnProperty(key)) {
scopedSinks[key] = sinks[key];
}
}
return scopedSinks;
}
I found out why it's not working.
On the line && typeof sources[key].isolateSink === 'function'
and ObservableisolateSink
Now I created my own isolate function. everything work fine now :D
I try to learn isolate but I have no idea why isolate won't work. this can run without error but no scope was added to element. ;(