I'm struggling to get the basic TypeScript feature to work properly. Everywhere I look on the Internet, it says that:
var a = "Bob"
var message = 'Hello ${a}'
should result in a console.log(message)
printing "Hello Bob".
However, when I try to do this:
import { Component } from '@angular/core';
import { environment } from '../environments/environment';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'etude';
constructor() {
console.log('Starting environment ' + environment.env_name + ' spark: ' + environment.spark_url + ' backend: ' + environment.backend_url);
const a = 'Starting environment ${environment.env_name} spark: ${environment.spark_url} backend: ${environment.backend_url}';
console.log(a);
}
}
My console is displaying:
Starting environment dev spark: http://localhost:9090 backend: http://localhost:9091 main.js:1:598971
Starting environment ${environment.env_name} spark: ${environment.spark_url} backend: ${environment.backend_url}
No matter what I try - using let a
or var a
instead of const a
.
According to my research online, shouldn't the transformation have happened right away?