Socket
Socket
Sign inDemoInstall

angular

Package Overview
Dependencies
Maintainers
1
Versions
144
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular - npm Package Compare versions

Comparing version 0.0.4 to 1.0.0

index-browserify.js

61

package.json
{
"name":"angular",
"author":"Edward Hotchkiss <edwardhotchkiss@me.com>",
"contributors":[
{ "name": "Edward Hotchkiss", "email": "edwardhotchkiss@me.com" },
{ "name": "Christopher Najewicz", "email": "chief@beefdisciple.com" }
],
"homepage":"http://github.com/edwardhotchkiss/node-angular",
"description":"Node.JS + AngularJS project generator",
"version":"0.0.4",
"repository":{
"type":"git",
"url":"git://github.com/edwardhotchkiss/node-angular.git"
"name": "angular",
"version": "1.0.0",
"description": "AngularJS provided as a CommonJS module. Compiled with jsdom when running in Node. Useful for client-side apps built with Browserify and for testing AngularJS code in Node without depending on a browser.",
"main": "index.js",
"browser": "index-browserify.js",
"scripts": {
"test": "tape test/index.js"
},
"keywords":["mvc","angular","routing", "angular.js"],
"engines":{
"node":">= 0.8.0"
"repository": {
"type": "git",
"url": "http://github.com/bclinkinbeard/angular.git"
},
"main": "./lib/index",
"bin" : {
"angular":"./bin/angular.js"
"keywords": [
"angular",
"angularjs",
"commonjs",
"require",
"testing"
],
"author": {
"name": "Ben Clinkinbeard",
"email": "ben.clinkinbeard@gmail.com"
},
"dependencies":{
"mongoose":"2.5.13",
"express":"2.5.10",
"colors":"0.6.0-1"
"license": "MIT",
"dependencies": {
"jsdom": "~0.8.8"
},
"devDependencies":{
"vows":"0.6.2"
},
"bugs": {
"url": "https://github.com/edwardhotchkiss/node-angular/issues"
},
"licenses":[{
"type":"MIT",
"url":"http://github.com/edwardhotchkiss/node-angular/LICENSE"
}],
"scripts":{
"test":"vows test/*.test.js --spec"
"devDependencies": {
"tape": "~2.1.0"
}
}
}

@@ -1,31 +0,70 @@

# node-angular [![Build Status](https://secure.travis-ci.org/edwardhotchkiss/node-angular.png)](http://travis-ci.org/edwardhotchkiss/node-angular)
angular
============
> Node.JS + Angular.JS project generator
AngularJS provided as a CommonJS module. Compiled with jsdom when running in Node. Useful for client-side apps built with Browserify and for testing AngularJS code in Node without depending on a browser.
Install:
## Versioning
```bash
$ sudo npm install angular -g
The version number of this module reflects the version of AngularJS it provides.
## Why
For client-side apps using Browserify, this module provides a way for them to use AngularJS without shimming.
Having a version of AngularJS that works outside the browser could also be convenient for many reasons. The primary motivation was around testability and modularity of AngularJS related projects. For developers utilizing the CommonJS standard and Browserify to build AngularJS projects and ecosystems, the hope is that this module will greatly simplify their workflow.
As [egghead.io](http://egghead.io) has shown, testing [simple views](https://egghead.io/lessons/angularjs-unit-testing-hello-world) and [directives](https://egghead.io/lessons/angularjs-unit-testing-a-directive) is a great way to ensure the pieces of your app are working as intended. Unfortunately, testing this way usually requires running your code in a real browser via something like Karma, because AngularJS assumes `window` and `document` are both available. Additionally, AngularJS (via `angular-mocks.js`) only exposes the `inject` method shown in the [egghead.io](http://egghead.io) videos if `window.jasmine` is defined.
This module allows you to test AngularJS views and directives using any testing framework and runner you like, from [Mocha](http://visionmedia.github.io/mocha/) to [Nodeunit](https://github.com/caolan/nodeunit) to [tape](https://github.com/substack/tape).
This module also aims to make it much easier to create AngularJS directives, modules, and other components that can be independently published to and versioned on npm and/or their own repositories.
## Examples
The `inject` method referenced above is really just a shortcut to `$injector.invoke`, but `$injector` is only available from within AngularJS. Fortunately, there are two ways to get a reference to Angular's injector from outside of AngularJS code.
```
// this will return a fresh instance of injector each time it's called
// if your code is not running in a browser you must use this method
var injector = angular.injector(['ng']);
Start a mongod process:
// provided only as an FYI, the following method WILL NOT WORK outside a web browser
// this will return the injector singleton for the application in which <element> is defined.
// for code that runs in a browser you could just use document if ng-app is defined on <html>
// otherwise you can use any element that is a descendent of the tag your app is defined/bootstrapped on
var injector = angular.element(<element>).injector();
```
See here for details - http://www.mongodb.org/display/DOCS/Starting+and+Stopping+Mongo
### Testing view compilation
Generate New Project:
```
var angular = require('angular'),
inject = angular.injector(['ng']).invoke,
num;
```bash
$ angular new myapp && cd myapp
$ npm install
$ npm test
$ angular server 9000
$ open http://localhost:9000/
inject(function ($rootScope, $compile) {
var el = angular.element('<div>{{ 2 + 2 }}</div>');
el = $compile(el)($rootScope);
$rootScope.$digest();
num = +el.html();
});
// num === 4
```
## License (MIT)
### Testing event handling
Copyright (c) 2012, Edward Hotchkiss.
```
var angular = require('angular'),
inject = angular.injector(['ng']).invoke,
answer;
### Author: [Edward Hotchkiss][0]
inject(function ($rootScope) {
$rootScope.$on('foo', function (e, val) {
answer = val;
});
$rootScope.$broadcast('foo', 'bar')
});
[0]: http://edwardhotchkiss.com/
// answer === 'bar'
```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc