@ -108,12 +108,12 @@ export class NgClass implements DoCheck, OnDestroy {
|
||||
this._initialClasses.forEach(className => this._toggleClass(className, !isCleanup));
|
||||
}
|
||||
|
||||
private _applyClasses(rawClassVal, isCleanup: boolean) {
|
||||
private _applyClasses(rawClassVal: string[] | {[key: string]: string}, isCleanup: boolean) {
|
||||
if (isPresent(rawClassVal)) {
|
||||
if (isListLikeIterable(rawClassVal)) {
|
||||
(<string[]>rawClassVal).forEach(className => this._toggleClass(className, !isCleanup));
|
||||
} else {
|
||||
StringMapWrapper.forEach(rawClassVal, (expVal, className) => {
|
||||
StringMapWrapper.forEach(<{[k: string]: string}>rawClassVal, (expVal, className) => {
|
||||
if (expVal) this._toggleClass(className, !isCleanup);
|
||||
});
|
||||
}
|
||||
|
@ -212,13 +212,15 @@ function _createProtoQueryRefs(bindings: BindingWithVisibility[]): ProtoQueryRef
|
||||
var res = [];
|
||||
ListWrapper.forEachWithIndex(bindings, (b, i) => {
|
||||
if (b.binding instanceof DirectiveBinding) {
|
||||
var directiveBinding = <DirectiveBinding>b.binding;
|
||||
// field queries
|
||||
var queries: QueryMetadataWithSetter[] = b.binding.queries;
|
||||
var queries: QueryMetadataWithSetter[] = directiveBinding.queries;
|
||||
queries.forEach(q => res.push(new ProtoQueryRef(i, q.setter, q.metadata)));
|
||||
|
||||
// queries passed into the constructor.
|
||||
// TODO: remove this after constructor queries are no longer supported
|
||||
var deps: DirectiveDependency[] = b.binding.resolvedFactories[0].dependencies;
|
||||
var deps: DirectiveDependency[] =
|
||||
<DirectiveDependency[]>directiveBinding.resolvedFactory.dependencies;
|
||||
deps.forEach(d => {
|
||||
if (isPresent(d.queryDecorator)) res.push(new ProtoQueryRef(i, null, d.queryDecorator));
|
||||
});
|
||||
|
Reference in New Issue
Block a user