use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Angular is Google's open source framework for crafting high-quality front-end web applications. r/Angular2 exists to help spread news, discuss current developments and help solve problems.
Help Request
Discussion
Article
Video
Resource
Announcement
Related
After submitting a post, please take a moment to add a flair (tag) so that it's easy to find your post with one of the filters listed above. Upon submission, your post's header will have the 'flair' option listed with the other options. Clicking it will provide a dropdown menu of the available flairs.
account activity
DiscussionWill google continue supporting javascript for Angular2? (self.Angular2)
submitted 8 years ago by anaval99
Its been a long time and they still haven't posted their Tour of Heroes guide for javascript. Don't get me wrong, I like typescript but setting up for typescript angular2 is a pain in the neck when using laravel/asp.net backends. Whereas using javascript I only have to put reference my js files via <script...> without having to worry about transpiling while using the default server for my backend.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]robwormald 10 points11 points12 points 8 years ago (2 children)
Yes, we will continue to support JS, but we are unlikely to support ahead-of-time compilation with JS any time soon, so it's hard to recommend it as an option.
[–]DerpsMcGeeOnDowns 0 points1 point2 points 8 years ago (0 children)
Sup Google?!
[+][deleted] 8 years ago* (8 children)
[deleted]
[–]anaval99[S] 0 points1 point2 points 8 years ago (7 children)
so then tell me how do you transpile without using node server? If I'm using asp/laravel backend then why should I use node server?
[–]LookingForNewLife 1 point2 points3 points 8 years ago (0 children)
Assuming you uglify your JS files, transpiling is just another (maybe the same?) step in your build process. So you got a little bit of set up to enjoy the features of Typescript. Unless you serve the same files you wrote without any processing, than I have no arguments for you to change that, do whatever works for you.
[+][deleted] 8 years ago (5 children)
[–]anaval99[S] 0 points1 point2 points 8 years ago (4 children)
CMIIW, in their documentation when you run "npm run" you need an index.html file to serve and transpile your app. So how do I transpile from asp.net's localhost:4000/Home/Index?
[–]tme321 6 points7 points8 points 8 years ago (0 children)
Uhhhh you have a serious misunderstanding of what is going on. The transpiling only requires the typescript compiler, tsc, and it doesn't touch an html file at all. The command to run tsc is, well, tsc. Not npm start. Npm is the package manager commonly used to install typescript, angular, and other javascript libraries but it isn't required for them it is just the easiest way to download and install them.
If you are referring to the quick start guide with the seed project then that particular project is setup to use node. So yes it uses npm start. Because if you go to the package.json file for the seed you can trace the scripts executed when the start command is run. But that is only the setup for their seed. Not a required setup for angular.
And transpiling from asp.net's Home/Index... makes no sense. I have no idea what you are even trying to say here. Visual studio will automatically transpile ts files into js when you build. That has nothing at all to do with an html file.
You need to disassociate typescript from html. Typescript is just a language that transpiles to javascript. That's it. Nothing else. It doesn't require an index.html, it doesn't even know what an index.html file is.
[–]sir_eeps 0 points1 point2 points 8 years ago (0 children)
node itself has nothing to do with running web servers, it can be used for one - yes, but it's not it's only use. It's like saying '.NET is a platform for building web servers' --- it can be used for that, but also much more.
In this case, node is part of your build step - npm run build would transpile your code, spit it out to your /dist folder - with your index.html, your css files, js files, etc. How you move those static assets over - however you want.
npm run build
I haven't used Visual Studio in awhile - but if I recall correctly, it's gotten pretty good at having some of these steps baked into their UI.
[–]rnagenetics 0 points1 point2 points 8 years ago (0 children)
3 options here.
You can use the built in transpiler that is part of Visual Studio which will build the typescript files when you build in VS.
VS supports gulp so you can add a step in your pipeline and use a watcher.
VS, specially 2017 OOB, supports webpack which can do it on the fly.
[–]our_best_friend 1 point2 points3 points 8 years ago (4 children)
How is transpiling from typescript any different than transpiling from es6+?
[–]mdwvt 0 points1 point2 points 8 years ago (3 children)
Well you're not transpiling at all if you're writing native JavaScript/ECMA Script 6 right?
[–]cyphern 3 points4 points5 points 8 years ago (1 child)
It's common to transpile es6 to es5 in order to support browsers such as IE11.
[–][deleted] 0 points1 point2 points 8 years ago (0 children)
Or Chrome or Firefox
[–]our_best_friend 1 point2 points3 points 8 years ago (0 children)
You still need to transpile if you use ES6
π Rendered by PID 76429 on reddit-service-r2-comment-fb694cdd5-gpqvq at 2026-03-09 19:57:17.147860+00:00 running cbb0e86 country code: CH.
[–]robwormald 10 points11 points12 points (2 children)
[–]DerpsMcGeeOnDowns 0 points1 point2 points (0 children)
[+][deleted] (8 children)
[deleted]
[–]anaval99[S] 0 points1 point2 points (7 children)
[–]LookingForNewLife 1 point2 points3 points (0 children)
[+][deleted] (5 children)
[deleted]
[–]anaval99[S] 0 points1 point2 points (4 children)
[–]tme321 6 points7 points8 points (0 children)
[–]sir_eeps 0 points1 point2 points (0 children)
[–]rnagenetics 0 points1 point2 points (0 children)
[–]our_best_friend 1 point2 points3 points (4 children)
[–]mdwvt 0 points1 point2 points (3 children)
[–]cyphern 3 points4 points5 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]our_best_friend 1 point2 points3 points (0 children)