Make visual studio understand angularjs in a new file - angularjs

This is probably a silly question but i am having troubles programming in angularjs with visual studio whenever i separate the application to different files.
For example, if i include everything in the same file (index.html):
<script src="libs/angular.min.js"></script>
var app = angular.module('myApp', []);
Visual studio automatically understands what is the object angular and what functions in contains and whenevery i type "angular.", it opens a window with suggestions.
But when i separate everything to different files, for example: app.js, routing.js, controllers.js, etc...
The application still runs but since i include angularjs in one file and use it in a different file, visual studio doesn't "help" me anymore...
So yeah.. it's silly but it really helps me program, especially because i'm new to angularjs.
Is there a way to fix it?
Thanks,
Arik

NuGet
If you would like to add AngularJS intellisence to your project you should add the NuGet package by John Bledsoe. There is a full article here it explains how to add the package so you have the coding help you require.
File Structure
There is a great article here that shows you the best way to structure your AngularJS application. Its a great article and can help when handling larger AngularJS projects but should be used even for smaller apps.

Related

Go to directive definition VS2015 like WebStorm

Not sure, If this is the right place to ask this question as its not related to any coding area problem.
My project, developed in AngularJs with web api, using VS2015, have grown big in code and structure. I have written many modules with directives, controller and services. If I am using webstorm I can easily navigate to directive definition from html by pressing CTRL + Mouse Left Click.
Is there any way like plugin or addon which I can add to Visual studio and manage to get same functionality?
I tried this but not much useful.
Try to check out these articles:
https://blogs.msdn.microsoft.com/vscode/2015/05/21/getting-started-with-angular-and-visual-studio-code/
https://code.visualstudio.com/Docs/languages/javascript
I know they're tutorials for VS Code, but the shortcuts might be the same.

How I get proper AngularJS intellisense support in Visual Studio 2013?

By proper I mean intellisense for HTML and JavaScript, i.e.
Typing <div ng-></div> should show intellisense as below.
and typing (in .js files) angular. should promt me with intellisense for controller, config etc as seen below (i'm after a more accurate intellisense than shown below actually, it seem to be giving me regular JS support, not Angular).
I'l also like support for your own controllers, so in the case you've defined your customController and/or service with your customFunction, i'd like that to be shown as well.
Here you can read about Using AngularJS in Visual Studio 2013, the article explains how to copy-paste a special angular.intellisense.js file into your C:\ drive.
Here's a SO answer regarding how to enable AngularJS support for ReSharper in Visual Studio. When I try this I only get the HTML intellisense, I get nothing for JS files to work.
Mads Kristensen points out The story behind _references.js in VS that will add JavaScript intellisense for the files you like.
I get the impression that all these ways can be solutions to the same problem: Getting AngularJS support in VS, but which is the most neat approach? Currently i've tried all of them and I feel there something i'm doing wrong, as i'm not very impressed so far.
Thanks a bunch for any help!
Try dragging angular.min.js file directly on the top of your .js file
surely it'll enable all the inbuilt intellisense, not sure about the custom controllers or directives you make.
hope it helps you :)
write this at the top of .js file starting from 3 forward slashes => ///

start project after cloning ng-boilerplate

I'm starting with angular.js and after reading realized that I should use ng-boilerplate to bootstrap my project. But I'm a bit confused, I've cloned the project and stuff and I have a project called ng-boilerplate with all the structure needed, but what now? Do I need to change the project name "ng-boilerplate" to my project name? And what about the folders for example "Home" and "About"? Do I need to delete these folders and create the ones I need? I guess I have to remove some code in other files right? the problem is that I'm starting with angular so don't know what should I remove and what not.
As you can see I'm pretty new with this, am I right with the procedure?
thanks
Well if you read the ngboilerplate documentation carefully you will understand it use. As the first line says:
ngBoilerplate is designed to make life easy by providing a basic
framework with which to kickstart AngularJS projects.
ngboilerplate like many other seed projects, provide a prescriptive guideline about how a project should be structured. To demonstrate the working of the setup some project like this one add implementation for some standard scenarios to highlight how the complete setup works. Remember a working sample is far better than writing lengthy documentation.
The pages that you have mentioned are indeed for demo purpose and you can remove the folders if required. What this organization is telling us is that group your model-view-controller implementation together into a folder. These folders could be one per view or one per feature. The documentation on the site itself is self explanatory here https://github.com/ngbp/ngbp/tree/v0.3.2-release/src/app
Almost all folders of ngboilerplate have some documentation around specifics of that area. Read it to learn more about it.

DotNetNuke Module Packaging

Does anyone know of any simple, concise tutorials for packaging DotNetNuke modules for DotNetNuke 4 and DotNetNuke 5? Preferably something concerning DotNetNuke 5.4, since that's what I'm running.
The examples that I've seen all assume background knowledge, or they are about short-cuts to the existing process. I'm a beginner, so I need the simple basics.
Yeah, it's kind of a nightmare the first time.
I started here: Creating a DotNetNuke® Module - For Absolute Beginners! It's DNN 4.x, so a few of the conventions may have changed, but it will probably be close enough to get you going.
Creating a DNN Module and Understanding DNN Architectural Approach goes into more detail:
I suppose the important concept is: you're writing a WebControl using the MVC pattern. The DNN Module Wizard will create a "view" page for you, and you add code to suit.
there's some good resources here for info on packages:
http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryId/1140/Packaging-and-protecting-your-DotNetNuke%C2%AE-Module.aspx
by Michael Washington (mentioned above)
http://www.dotnetnuke.com/Development/Forge/ModuleReports/tabid/970/EntryId/453/DotNetNuke-4-3-Starter-Kit-and-Item-Templates.aspx
by Shaun Walker
Simple basics...
When you start with the DNN module template in Visual Studio there's a standard .dnn file there. this file must be modified to include all files needed to run the module (resx, images, dlls, ascx, .sqldataprovider) without any of the sourcecode files (.cs, .vb).
zip all of the files mentioned in the .dnn file up with the dnn file (all files in root of the zip) and submit it to the upload new module page (logged in as Host).
the zip is automatically extracted, the .dnn file is read and all files are placed in the appropriate places.
resources for creating packages:
http://www.codeproject.com/KB/dotnet/DnnModulePackager.aspx
http://www.mitchelsellers.com/blogs/articletype/articleview/articleid/200.aspx
by looking at these you can also further your understanding of package creation.
i'm using 4.9 currently so someone may want to correct me on changes that i'm unaware of.
Google for Michael Washington and / or Mitchel Sellers and they have excellent work on Module Development.
Mark Breen
Ireland
Chris Hammond has recently written two blog posts on dotnetnuke.com about packaging modules, you should really have a look that those, they are super, he tells you how to set up your environment and how to create a C#Template for your modules.
thanks
Mark
A good place to start is use the IFrame module. It's all code behind so no compile needed before deployment. Look in the dnn file to see where the files are copied to.
You might also want to look at https://github.com/dazinator/DnnPackager which is a NuGet package that when added to your module project, automates production of the install zip, and has other features

Can this be done by skinning?

I am working on DNN 4.09.03. I want to modify the look and feel of a links module. I know how to change the outer looks with containers, but I want achieve a mouseover effect for the links itself.
Looking closely it appears that the links are placed into a table datacell. I want to set the background of that cell to and image, and on mouseover swap it for another image. Can this be done with skinning?
If not, I need some assistance in extending/customising the links module source. I need to know how to set up the development environment to do this first. I have the DotNetNuke solution (with source code) working in VS2008. How do I integrate the source of the links module, so i can customise it (and rename - maybe mylinks)?
I don't think you can do this by containers. If you can do it by any chance, I bet doing it by modifying the code is easier. You have to remember that you might have problems upgrading the links module in future if you modify it.
Just add the Links module to DNN VS2008 solution as a web application. You can do whatever change you won't to do in it. And then use a nant script to just package it and copy to DNN/Install/Modules folder. And then hit the DNN installation URL:
http://<dnn_url>/Install/Install.aspx?mode=installresources
Alternatively you can write some post-build commands in VS2008 it self to copy stuff. Have a look at the existing modules and where each different part files of a module (.ascx, .dnn, .sqldataprovider) is stored in DNN after installation.
This is possible with some creative CSS and maybe even a little jQuery - i did a lot of this sort of thing for the Blog module without having to touch the core module -

Resources