We've recently started to migrate to Angular2 from another framework, most of my component templates are not inline and are in separated HTML files.
Is there any plugin that would provide something like IntelliSense inside the HTML?
For example, it would be great to see a list of methods of the component, or a list of properties of an item of a collection iterated with a NgFor directive.
I have failed to find such a thing.
We are using Visual Studio 2015.
I am assuming you haven't come across the latest visual code IDE.
You can go on to Visual Studio to download the latest, I believe that only when you're using interfaces or classes, Intellisense will kick in. I encourage you to use this if you're into using this for your development.
You need to download VS Code and the Angular Language Service plug-in.
Related
I'm playing around with Azure Functions but I've noticed VS 2015 doesn't provide intellisense for .csx files.
Any idea how to fix this?
This isn't an issue with your configuration. IntelliSense support with csx is limited and will be improved in future tooling releases (also targeting VS Code and the portal).
Follow this blog post Publishing a .NET class library as a Function App and don't look back. Full C#, (not .csx.), C# 7 (if using VS2017), and full intellisense and debugging.
Basically the approach is instead of creating a Function Project (in VS2015 only), instead create an ASP.NET project and use the Azure Function CLI to create the actual functions. Then you are not dealing with .CSX files which have poor support within the VS editor.
From the New Project dialog, choose ASP.NET Web Application (.NET Framework) with the empty site template.
Open the project properties. In the Web tab, choose Start External Program
For the program path, enter the path to func.exe for the Azure Functions CLI. If you’ve installed the Visual Studio Functions Tooling, the path will look something like C:\Users\USERNAME\AppData\Local\Azure.Functions.Cli\1.0.0-beta.93\func.exe If you’ve installed the Azure Functions CLI through NPM, the path will be something like C:\Users\USERNAME\AppData\Roaming\npm\node_modules\azure-functions-cli\bin\func.exe
For Command line arguments, set host start
For Working directory, specify the root of the web project on your machine (unfortunately, this isn’t set automatically.)
One solution is to develop your Function as a Precompiled function as explained here: https://github.com/Azure/azure-webjobs-sdk-script/wiki/Precompiled-functions
I got fed up very quickly of the limited intellisense.
I can't seem to find a way to make T4 templates in VS 2015 RTM, in an ASP.NET 5 (vNext) project.
I even installed the T4 toolbox for Visual Studio 2015 extension, but the tt templates are not transformed.
The property Custom Tool doesn't appear in the tt file properties, neither can't I find the 'Run Custom Tool' command.
Update
The reason I want the T4 templates, is the introduction of the config.json file, and the pluggable configuration system, which is an awesome thing, but with the price of not having the setting properties strongly-typed.
I've read this article that explains how to achive this, but there is still no generation. Since I have a pretty complex configuration structure, I thought about making a T4 template that will generate an AppSettings file. Any ideas on that are obviously welcome too.
The ASP.Net 5 (vnext) project is a completely new animal and technically still in beta, its not scheduled for RC til November 2015. Also it's attempting to be completely cross platform so initially the team favored using razor templates instead of T4 for scaffolding. They had no plans to support T4 (or any single file generators) at all until an out cry from the community made them change their mind. According to that thread they will support it but have given no dates. They do seem to have made progress, back in January when I was testing my T4 extension I had issues with the project file(now in json format) not supporting custom properties but as of the release on 7/20/2015 it seems to work now. The engine for running T4 inside of visual studio 2015 is still there so you can use it if you like from other project types. You can create a console app and have it store the T4 files but generate them in the vnext project. If you want a cleaner solution you can also try out my extension T4 Awesome, it gives you a way to organize and call your templates via right click menus.
I've found that I can still use the MSBuild targets that ship with the Modeling SDK for Microsoft Visual Studio 2015 when building an ASP.NET 5 project with ASP.NET 5 RC1.
I got there by modifying the directions from
MSDN - Code Generation in a Build Process.
Add the *.tt and the output files (*.cs in my case) to the project folder structure.
Unload and edit the project's *.xproj file.
Add the following Import element after the Microsoft.DNX.targets import:
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TextTemplating\Microsoft.TextTemplating.targets" />
Add an ItemGroup element similar to the following (I added this immediately before the import statements):
<ItemGroup>
<Content Include="MyTemplate.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>MyTemplate.cs</LastGenOutput>
</Content>
</ItemGroup>
Optionally, you can add elements to the Globals PropertyGroup element to control the transformation task:
<TransformOnBuild>true</TransformOnBuild>
<TransformOutOfDateOnly>false</TransformOutOfDateOnly>
<OverwriteReadOnlyOutputFiles>true</OverwriteReadOnlyOutputFiles>
Reload the project's *.xproj and build normally.
The templates I'm using are pretty simple, so there might be limitations of this approach that I'm missing out on.
If you watch Julie Lerman's pluralsight video: http://www.pluralsight.com/courses/entity-framework-7-looking-ahead she addresses this. There are no plans as of now to remove the T4 templates in upcoming versions of Visual Studio but they didn't make it in for the release. You code always run the reverse engineer tool on your database and go with a code first approach and switch back later (though I don't know why you would in my opinion) but that would be a work around until there is more information on the T4 templates in current VS versions.
I see that MS has documentation on how to implement nesting projects when implementing new project types. While this looks do-able, I'd rather not write and maintain my own VS extension if I can avoid doing so. Is there any "generic" project type already implemented by some extension that will allow project nesting? The idea would be that the parent project does nothing but include its children and allow building, adding references, etc.
Managed Package Framework for Projects is for Visual Studio 2013 and includes "a project system that supports nesting" (see the NestedProject sample). I have not tried it myself, though I did look through it a while back (the VS 2010 version) and it has thorough documentation.
It may or may not be as extensive as what you are looking for. From the overview in the documentation:
Creating a new project type in Visual Studio is complex task. Using MPF_Proj is a good starting point for creating custom project types in Visual Studio written in managed code but there are limitations that would have to be considered before using the framework.
MPF_Proj is not a .NET library. It is rather a framework of source files (classes, utilities etc.) that can be included in a VSPackage project.
I am looking at phoneJs and they talk about using nuget. However they don't say what their solution is. It looks like it is a javascript solution project but I don't see that in VS2012.
PhoneJs
It can be ASP.NET project (WebForms, MVC) or Window Store Javascript application.
Screenshots at the page you refer most probably display Windows Store project. This kind of project is only available in Windows 8.
P.S. Additional project templates with PhoneJS are included in DevExtreme: documentation.
I've updated my default templates in Visual Studio for classes, interfaces, code files, etc. I removed the default namespaces and added a copyright header blurb.
Is there a way to use a variable or something in the template so I don't have to zip/unzip and re-run the vs installer to change the copyright header? (I'm a consultant, the code-owner isn't always me or my company).
Yes, you can. The documentation for this sort of thing is part of the Visual Studio SDK. There are already many variables you can use.
If you find you want to get fancy, look into the Guidance Automation Toolkit. A template using GAT can accept user input as well as information from the project and environment, can unfold one or more templates, filling in placeholders with the data gathered, and then can execute various actions against the unfolded templates, the project, or whatever.
You can get the complete example implemented here: Multi-Project Templates with Wizard: Visual Studio 2010 Sample