So in Angular (2/4), the only things accessible in the template are things that fall within the scope of your corresponding component's class - ie. anthing you could say "this.blah" in the ts.
So, you can in fact do what you propose, but you need to add console into the scope of your component:
@Component({
selector: 'my-component',
template: `This is my template {{console.log(variable)}}`
})
export class MyComponent {
console = console;
variable = 'yay';
}
(the key line here is console = console;
)
And then this will output 'variable' with the text 'yay' to the console - the catch is that it will do that every time the expression is rendered... which will often be many times. So it's not particularly good practice, but if you're just debugging it could be ok.