Only 'amd' and 'system' modules are supported alongside --out error in visual studio 2015 - angularjs

I want to combine Angularjs and TypeScript in a asp.net web api, so I try this blog post: LINK
when I run my application I encounter whit this error:
Error Build:Only 'amd' and 'system' modules are supported alongside --out.
I tried this post and install both of Microsoft.TypeScript.MSBuild and Microsoft.TypeScript.Compiler, but it still stops with that error.
so I try this post, but I don't know how to modify tsconfig.json because it uses visual studio code and I use visual studio 2015.
can you help me?
thanks

Choose "none" in the TypeScript module type under the project (.csproj) properties -> TypeScript Build.
In Visual Studio 2015, the TypeScript Build tap seems to have an issue. When selecting "none", it does not always work. I got it to work by unloading the project and editing the following entry manually in the .csproj file.
<TypeScriptTarget>ES5</TypeScriptTarget>
<TypeScriptJSXEmit>None</TypeScriptJSXEmit>
<TypeScriptCompileOnSaveEnabled>True</TypeScriptCompileOnSaveEnabled>
<TypeScriptNoImplicitAny>False</TypeScriptNoImplicitAny>
<TypeScriptModuleKind>None</TypeScriptModuleKind> <----- Set this value to None
<TypeScriptRemoveComments>False</TypeScriptRemoveComments>

Related

Error creating a project using HSPI template

I followed "Project templates for Visual Studio 2015 and Visual Studio 2017", but when I create a project using the template, I get following error:
Package Installation Error
The preinstalled packages have a reference to a missing Extension.
Could not find an Extension with ID 'HomeSeerTemplates.Alex Dresko.82028f47-9623-4359-a6bf-244390c19608'.
Long story short, try uninstalling the extension and reinstall it. I apologize for the inconvenience, but you shouldn't have to do that again. I goofed a couple weeks ago and messed some things up. Let me know if the new version of the extension works.
https://marketplace.visualstudio.com/items?itemName=thealexdresko.HomeSeerTemplates2

Upgrade GoogleTest to Visual Studio 2013 with command line

I've been attempting to automate the cloning and building of google test by using a batch script. However I can't seem to get visual studio to upgrade the solution.
I tried using the devenv "path" /upgrade command however it fails to upgrade the projects. The error I am getting for each of the projects is:
gtest_main-md.vcproj: The application which this project type is based on was not found. Please try this link for further information: http://go.microsoft.com/fwlink/?LinkID=299083&projecttype=8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942
Which just defaults to the VS2015 C++ projects page. The solution also states that it does not need to be upgraded. If I open the solution in visual studio I can simply perform the one time upgrade on each project with no issue.
Is there a way to do this without having to open visual studio?

How to get AngularJS Intellisense in Visual Studio 2015

I am using VS2015 Enterprise. In which I have created MVC Project and added file named "angular.min.js" downloaded from angularjs.org but Angular intellisense is not working. Although I have referenced this file in my custom javascript file named "AngularScript.js" as shown in figure.
The most easiest way to get intellisense is to install angularjs package from "Manage Nuget Packages" as shown in figure below.
just install this package and this will resolve all your issues regarding intellisense and other. Do this and enjoy the AngularJS intellisense in your application. :-)

angularjs definitely typed visual studio 2015

I'm trying to get my first angularjs project to work within Visual Studio 2015. Worked fine until I tried to move to Typescript. Installed the DefinitelyTyped projects and get lots of error messages.
Here is how to reproduce it:
Create an empty ASP.NET 4.5.2 application
Nuget AngularJS Core 1.4.4
Nuget AngularJS.TypeScript.DefinitelyTyped 4.1.1 (includes jQuery 0.0.1)
Add an empty TypeScript file
Add
/// <reference path="typings/angularjs/angular.d.ts" />
to that file.
that's when I get 444 errors, starting with
Error TS2411 Property 'find' of type '{ (selector: string):
IAugmentedJQuery; (element: any): IAugmentedJQuery; (obj: JQuery):
IAugment...' is not assignable to string index type 'HTMLElement'.
TypeScript Virtual Projects l:\M\eigene dateien\visual studio
2015\Projects\WebApplication3\WebApplication3\Scripts\typings
\angularjs\angular.d.ts
Any idea what I'm doing wrong or how to work around it?
I checked this package and most of the errors seem to come from the jquery.d.ts file, which just looks old. That file still uses "bool" instead of "boolean", which was a breaking change made long ago.
I fixed it by adding "jQuery.Typescript.DefinitelyTyped" to the project, which upgraded the jQuery.d.ts file to a version that parsed properly. As soon as I did that, all of the compiler errors went away.
This seems like a bug in the nuget package authoring. I'll look into opening an issue on github.
Hope that works for you.
UPDATE: I opened this issue in GitHub https://github.com/borisyankov/DefinitelyTyped/issues/5446
I had the same issue, but the above solution didn't work out for me.
jQuery.Typescript.DefinitelyTyped was already installed as it is required by angularjs.TypeScript.DefinetlyTyped package.
I fixed it by:
uninstall angularjs package.
uninstall angularjs.TypeScript.DefinetlyTyped package.
uninstall jQuery.Typescript.DefinitelyTyped
install jQuery.Typescript.DefinitelyTyped
install angularjs.TypeScript.DefinetlyTyped package.
install angularjs package.
Thanks Michael for supplying the hint.
The issue is caused by NuGet in VS 2015, because it defaults to installing the oldest version of its dependencies which in this case installs ancient jQuery DT package for the AngularJS DT package, as explained here.
I fixed this even simpler by just doing these:
Manage NuGet packages for project
Show only installed packages
Select jquery.TypeScript.DefinitelyTyped
Upgrade
Enjoy!

Angularjs - Resharper intellisense broken with TypeScript?

I have VS 2013 Update 4, TS 1.4, latest WebEssentials and R# 8.
I am trying to create some AngularJS code in my MVC solution.
In installed Angularjs and angular.d.ts via nuget. I have done the same for "marked" and also jQuery installed automatically as Angular dependency.
How, none of Angular types get resolved by Intellisense. If I am trying to type "mar" in an empty TypeScript file I get this:
If I type "jque" I get this:
But when I type "ang" - nothing.
All d.ts files are in place:
Adding reference path directive does not help, although it is not required and Intellisense works perfectly fine for other frameworks. Manual typing without Intellisense support works fine and I get no compilation errors, so TSLint and tsc are ok with my code.
So, my question is - what is going on there?
P.S. Just added Knockout to test this and typing "ko" brings proper Intellisense.
P.P.S. I turned off the TS support in R# and intellisense seems to work properly. So, I would assume this is the Resharper issue.
I turned off the TS support in R# and intellisense seems to work properly. So, I would assume this is the Resharper issue
Yes. They need to update for v1.4 of typescript. You can use an older angular.d.ts till then : https://github.com/borisyankov/DefinitelyTyped/blob/1.3.0/angularjs/angular.d.ts
As basart mentioned, rather than installing EAP or turning Resharper off, you can use an older version of the file for the interim period. But I advise against adding it manually in your solution. Version 1.7.4 of jQuery d.ts and version 2.4.0 of Angular d.ts worked for me and you can use NuGet from the Package Manager command line in Visual Studio to install them.
Install-Package jquery.TypeScript.DefinitelyTyped -Version 1.7.4
Install-Package angularjs.TypeScript.DefinitelyTyped -Version 2.4.0
Make sure you select your project in the dropdown box inside the console before running the command.
I had this problem a little earlier today, where inline intellisense was flagging angular, as well as various interfaces (usually IPromise<T>) as not being found, despite having reference metacomments and the files present in my project.
Similar to the answer from #basarat, I was able to disable ReSharper Intellisense (Resharper | Options... | Intellisense | General), restart Visual Studio, and then re-enable TypeScript Intellisense. Upon re-enabling intellisense, I no longer get red squigglies.
I did this in Visual Studio 2015, ReSharper 2016.3.2, on a project that is using Angular 1.6 and TypeScript together, with no tsconfig.json file (configuration is done in the TypeScript tab of the Web project.)

Resources