npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-mvc6-angular

v0.3.1

Published

MVC 6 Angular Yeoman generator

Downloads

11

Readme

generator-mvc6-angular Build Status

Yeoman generator

Attention: This generator is now deprecated in favour of the generator-aspnet generator which is more actively developed and includes AngularJS support.

ASP.NET Core (got renamed) is still young and faces huge changes. I currently do not have the time to keep up with them with my schedule. Thank you everyone for the support and the downloads :)

Note: You need to have Visual Studio 2015 installed. The Community version can be downloaded for free here. Visual Studio 2013 does not support MVC 6, unless you find a way to open vNext .kpoj files.

Note: vNext .kproj files are now depreciated in favour of .xproj, and now Visual Studio 2015 has the option to open the project.json file which will generate a .xproj file. Therefore I have removed all .kproj and .xproj in favour of generating the .xproj yourself from the project.json

Note: You may need PowerShell 3.0+ on Windows 7. Click here to learn more

Getting Started

npm install -g yo

To install generator-mvc6-angular from npm, run:

npm install -g generator-mvc6-angular

Initiate the generator:

yo mvc6-angular

Follow the instructions on the generator. It will prompt you for the name of the app.

The Visual Studio 2015 project is located in: \src\[PROJECT NAME]\[PROJECT NAME].kproj. When you first exit the project, it will try to create the other nessesary Visual Studio files, including the Solution (.sln) file. It is recommended for tidyness to save the .sln file in the root (same path as the .gitignore). This is because Visual Studio will create other user preferance meta-data (.suo files) not related to the source of the app.

Running

Note: A grunt watch will be made in the future so you wouldn't need to build everytime

  1. To build, you run, you must go to the Task Runner Explorer, and run the build task. This will build the angular front-end into the wwwroot folder.

  1. Then press the start button

Creating the client

As you know, the client is made with Angular, and its all in the Client folder. app.js is the main file which declares your app's namespace, and the rest of the Angular app is inside the App folder.

Inside the App folder, you get the Components folder, which stores the components of the app, and the rest of the different pages. You are provided with a default Main folder, which is the main page you see when you start the app.

By default, the generator uses superior ui.router, to add more routes, edit the app.js file. I will add options for future releases though.

Directory structure

Here is the directory structure for the Client folder:

├── Client
│   ├── App                 - All of our app specific components go in here
|   |   ├── Components      - Our reusable components, non-specific to to our app
│   |   ├── Main            - Specific app component
│   |   └ app.js            - Main AngularJS file which wires angular dependancies.
│   ├── Assets              - Custom assets: fonts, images, etc…
│   └── index.html          - App main page (ng-app lives here)
│

Building the client

As mentioned above, for your changes to show on the browser, you must build the client using Grunt by using the Task Runner Explorer. The build script contains uglifying, concating and js and sass files.

If you are fancy, you can set up automatic building upon Starting the app by adding a binding:

Sub-generators

Front-end

Page

Generates a folder containing a controller, a HTML view and a route to allow access to: http://localhost/[YOUR PAGE]

Example:

yo mvc6-angular:page Portfolio

Produces:

src/[APP NAME]/Client/App/portfolio/portfolio.html
src/[APP NAME]/Client/App/portfolio/portfolio.controller.js
src/[APP NAME]/Client/App/portfolio/routes.js

Back-end

Endpoint

Generates a new API endpoint.

Example:

yo mvc6-angular:endpoint Messages

Produces:

src/[APP NAME]/Server/API/MessagesController.cs

Visual Studio Equivalent

We recommend you to make a RESTful service to communicate with the Angular Client to a nice and clean separation of concern:

  1. To do so, right click a folder, and select Add > New Item:

  1. Select Web API Controller Class to generate a RESTful API template.

Features

  • Bootstrap
  • Angular
  • Grunt - ASP.NET MVC6 has the Task Runner Explorer which has built in Grunt support!
  • Bower, NPM and NuGet - Built in support for these three repositories! To install new dependencies, right click > restore

  • jit-grunt for increased build speed
  • No More Web Forms
  • No More Visual Basic
  • Tag Helpers
  • Edit while running the solution like Classic ASP editing
  • ASP.NET Dependency Injection Framework

License

(The MIT License)

Copyright (c) Dolan Miu

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.