Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8743397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:40:08+00:00 2026-06-13T11:40:08+00:00

I have a typescript project working fine. I created a second project and copy

  • 0

I have a typescript project working fine. I created a second project and copy some of my previous code via the file system. Everything works fine with the exception of the fact that my .js is now not in sync with my .ts.
I now how to solve the problem: removing both files and copy the again using Visual Studio interface by dragging the ts file (that will carry the .js automatically)
Anyway, I got curious and now I want to know, how is the .ts and the .js know each other?.
In ASP.NET you have the notion of code behind., but here I do not see how this done.
is Visual Studio keeping the relationship in the a hidden file?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:40:09+00:00Added an answer on June 13, 2026 at 11:40 am

    In the typescript language specification on page 75 (chapter 9.1):

    By default, a JavaScript output file is generated for each implementation source file in a
    compilation, but no output is generated from declaration source files.

    There is no real association between ts and js files other than the name. A ts file is compiled to a js file and at runtime the js files are loaded. Note that the actual naming of the js files is independent of the module names and you are responsible yourself to load the scripts accordingly (e.g. using <script> in your html page).

    In your case it should be fine to just copy and add a reference to the ts files. After you add the reference, be sure to change the Build Action to “TypeScriptCompile” to make sure it is passed to the typescript compiler: Select the file in solution explorer, press F4 to bring up the properties window and change the Build Action.

    Update: To make the files “nested”, as mentioned in the comment, you can unload the project and add a child element to the js element, e.g. transforming

    <Content Include="some.js" />
    <TypeScriptCompile Include="some.ts" />
    

    to

    <Content Include="some.js">
        <DependentUpon>some.ts</DependentUpon>
    </Content>
    <TypeScriptCompile Include="some.ts" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a test project on TypeScript, code can found here . When I'm
I have spent some time reading the Typescript language specification and am somewhat confused
I've been working with TypeScript and MVC4 today. Everything is working well but every
Have a fun issue with sharepoint calendar view filtering. That code works fine: SPSecurity.RunWithElevatedPrivileges(delegate()
If I have this TypeScript code: module Foo { var x : string =value;
I have just downloaded the TypeScript documentation. I have a some JavaScript classes and
I have the following code: ///<reference path=../typescript/jquery.d.ts /> function addThemePrototypes() { var templateSetup =
I have defined the following interface in typescript: interface MyInterface { () : string;
I am trying to use TypeScript in a Windows 8 app (html5/JS) I have
I have a field mapped in TemplaVoila as container of elements which generates some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.