By default sublime check extension of file and set highlighting for language (based on extension). For your case he knows that
.ts extension so he choosed plain text.
If sublime does not recognize which language the file has you can still define language in file manually.
In the right bottom corner in Sublime you can see for second file the "syntax highlighting" is set to Plain text.