requirejs-angular-starter

Get started with large scale angular applications and require.js.

Homepage

Angular Core Dependency: ~1.2.24

Added by: Sam Deering

GitHub

Repository

jcreamer898/requirejs-angular-starter

Stats

Stars: 35

Watchers: 35

Forks: 19

Author

Jcreamer898
Jcreamer898

Module Description

requirejs-angular-starter

This repository is a starting place for building large scale angular.js applications with require.js.

To get started, clone or fork the repo and use it as your starting place!

Require.js Packages

This starter uses require.js packages to organize the app into smaller pieces. Have a look in the starter folder.

You'll see a main.js.

define(function(require) {
    var angular = require("angular"),
        name = "my.starter",
        ngModule;

    ngModule = angular.module("my.starter", [])
        .controller("StarterCtrl", require("./starterCtrl"));

    return {
        name: name,
        ngModule: ngModule
    };
});

The job of this file is to create a module, and return an object containing at least a name.

In the application's main.js you need to add the package.

packages: ["starter"]

In app.js you require the package, and then utilize the package.name.

 var starter = require("starter");

    angular.module("app", [
        "ngRoute",
        starter.name
    ]);

Build

To create a build of your app, first install node, and then run...

npm install -g require.js

Then run,

r.js -o app.build.js

This will create a /dist folder with the built app.

Note: the dist folder is included in this repository, but you may want to add dist to your .gitignore to keep it out of git

Module stats last updated: 2017-03-04 16:00:04

Disclaimer: Some data on this page may have been gathered from the authors GitHub respository. If you see any mistakes or outdated information please let us know. Thanks!