Yes, it is possible, you could create additional decorator which will replace class field with getter/setter pair, getter will return Subject and setter will do next on this subject.
Please note that it will likely break AOT compilation.
@Input()
@Reactive(false)
public subject:Subject<boolean>; //you don't even need to initialize
export function Reactive(initialValue:any):Function
{
return function(target:Object, property:string)
{
const name:string = `__subject_${property}`;
Object.defineProperty(target, name, <PropertyDescriptor>{
enumerable : false,
configurable: false,
writable : true
});
Object.defineProperty(target, property, <PropertyDescriptor>{
enumerable : true,
configurable: false,
get : function():any
{
if(this[name] === undefined)
{
this[name] = new BehaviorSubject<any>(initialValue);
}
return this[name];
},
set : function(val:any):void
{
if(this[name] === undefined)
{
this[name] = new BehaviorSubject<any>(initialValue);
}
this[name].next(val);
}
});
}
}