Commit 1de82da0 authored by Kostantinos  Margaritis's avatar Kostantinos Margaritis Committed by Sindre Sorhus

Close #1141 PR: Angularjs: Upgrade to NPM. Fixes #1110

parent f79d2a8a
node_modules
node_modules/angular/*
!node_modules/angular/angular.js
node_modules/angular-route/*
!node_modules/angular-route/angular-route.js
node_modules/angular-mocks/*
node_modules/todomvc-app-css/*
!node_modules/todomvc-app-css/index.css
node_modules/todomvc-common/*
!node_modules/todomvc-common/base.css
!node_modules/todomvc-common/base.js
{
"name": "todomvc-angular",
"version": "0.0.0",
"dependencies": {
"angular": "1.3.11",
"todomvc-common": "~1.0.0",
"todomvc-app-css": "~1.0.1"
},
"devDependencies": {
"angular-mocks": "1.3.11",
"angular-route": "1.3.11"
}
}
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>AngularJS • TodoMVC</title> <title>AngularJS • TodoMVC</title>
<link rel="stylesheet" href="bower_components/todomvc-common/base.css"> <link rel="stylesheet" href="node_modules/todomvc-common/base.css">
<link rel="stylesheet" href="bower_components/todomvc-app-css/index.css"> <link rel="stylesheet" href="node_modules/todomvc-app-css/index.css">
<style>[ng-cloak] { display: none; }</style> <style>[ng-cloak] { display: none; }</style>
</head> </head>
<body ng-app="todomvc"> <body ng-app="todomvc">
...@@ -63,9 +63,9 @@ ...@@ -63,9 +63,9 @@
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p> <p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
</footer> </footer>
</script> </script>
<script src="bower_components/todomvc-common/base.js"></script> <script src="node_modules/todomvc-common/base.js"></script>
<script src="bower_components/angular/angular.js"></script> <script src="node_modules/angular/angular.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script> <script src="node_modules/angular-route/angular-route.js"></script>
<script src="js/app.js"></script> <script src="js/app.js"></script>
<script src="js/controllers/todoCtrl.js"></script> <script src="js/controllers/todoCtrl.js"></script>
<script src="js/services/todoStorage.js"></script> <script src="js/services/todoStorage.js"></script>
......
/** /**
* @license AngularJS v1.3.11 * @license AngularJS v1.3.12
* (c) 2010-2014 Google, Inc. http://angularjs.org * (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT * License: MIT
*/ */
...@@ -482,21 +482,15 @@ function $RouteProvider() { ...@@ -482,21 +482,15 @@ function $RouteProvider() {
* definitions will be interpolated into the location's path, while * definitions will be interpolated into the location's path, while
* remaining properties will be treated as query params. * remaining properties will be treated as query params.
* *
* @param {Object} newParams mapping of URL parameter names to values * @param {!Object<string, string>} newParams mapping of URL parameter names to values
*/ */
updateParams: function(newParams) { updateParams: function(newParams) {
if (this.current && this.current.$$route) { if (this.current && this.current.$$route) {
var searchParams = {}, self=this;
angular.forEach(Object.keys(newParams), function(key) {
if (!self.current.pathParams[key]) searchParams[key] = newParams[key];
});
newParams = angular.extend({}, this.current.params, newParams); newParams = angular.extend({}, this.current.params, newParams);
$location.path(interpolate(this.current.$$route.originalPath, newParams)); $location.path(interpolate(this.current.$$route.originalPath, newParams));
$location.search(angular.extend({}, $location.search(), searchParams)); // interpolate modifies newParams, only query params are left
} $location.search(newParams);
else { } else {
throw $routeMinErr('norout', 'Tried updating route when with no current route'); throw $routeMinErr('norout', 'Tried updating route when with no current route');
} }
} }
......
/** /**
* @license AngularJS v1.3.11 * @license AngularJS v1.3.12
* (c) 2010-2014 Google, Inc. http://angularjs.org * (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT * License: MIT
*/ */
...@@ -54,7 +54,7 @@ function minErr(module, ErrorConstructor) { ...@@ -54,7 +54,7 @@ function minErr(module, ErrorConstructor) {
return match; return match;
}); });
message = message + '\nhttp://errors.angularjs.org/1.3.11/' + message = message + '\nhttp://errors.angularjs.org/1.3.12/' +
(module ? module + '/' : '') + code; (module ? module + '/' : '') + code;
for (i = 2; i < arguments.length; i++) { for (i = 2; i < arguments.length; i++) {
message = message + (i == 2 ? '?' : '&') + 'p' + (i - 2) + '=' + message = message + (i == 2 ? '?' : '&') + 'p' + (i - 2) + '=' +
...@@ -381,8 +381,7 @@ function nextUid() { ...@@ -381,8 +381,7 @@ function nextUid() {
function setHashKey(obj, h) { function setHashKey(obj, h) {
if (h) { if (h) {
obj.$$hashKey = h; obj.$$hashKey = h;
} } else {
else {
delete obj.$$hashKey; delete obj.$$hashKey;
} }
} }
...@@ -691,7 +690,7 @@ function isElement(node) { ...@@ -691,7 +690,7 @@ function isElement(node) {
function makeMap(str) { function makeMap(str) {
var obj = {}, items = str.split(","), i; var obj = {}, items = str.split(","), i;
for (i = 0; i < items.length; i++) for (i = 0; i < items.length; i++)
obj[ items[i] ] = true; obj[items[i]] = true;
return obj; return obj;
} }
...@@ -1472,8 +1471,12 @@ function bootstrap(element, modules, config) { ...@@ -1472,8 +1471,12 @@ function bootstrap(element, modules, config) {
forEach(extraModules, function(module) { forEach(extraModules, function(module) {
modules.push(module); modules.push(module);
}); });
doBootstrap(); return doBootstrap();
}; };
if (isFunction(angular.resumeDeferredBootstrap)) {
angular.resumeDeferredBootstrap();
}
} }
/** /**
...@@ -2118,11 +2121,11 @@ function toDebugString(obj) { ...@@ -2118,11 +2121,11 @@ function toDebugString(obj) {
* - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat". * - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
*/ */
var version = { var version = {
full: '1.3.11', // all of these placeholder strings will be replaced by grunt's full: '1.3.12', // all of these placeholder strings will be replaced by grunt's
major: 1, // package task major: 1, // package task
minor: 3, minor: 3,
dot: 11, dot: 12,
codeName: 'spiffy-manatee' codeName: 'outlandish-knitting'
}; };
...@@ -4157,7 +4160,7 @@ function createInjector(modulesToLoad, strictDi) { ...@@ -4157,7 +4160,7 @@ function createInjector(modulesToLoad, strictDi) {
} }
var args = [], var args = [],
$inject = annotate(fn, strictDi, serviceName), $inject = createInjector.$$annotate(fn, strictDi, serviceName),
length, i, length, i,
key; key;
...@@ -4196,7 +4199,7 @@ function createInjector(modulesToLoad, strictDi) { ...@@ -4196,7 +4199,7 @@ function createInjector(modulesToLoad, strictDi) {
invoke: invoke, invoke: invoke,
instantiate: instantiate, instantiate: instantiate,
get: getService, get: getService,
annotate: annotate, annotate: createInjector.$$annotate,
has: function(name) { has: function(name) {
return providerCache.hasOwnProperty(name + providerSuffix) || cache.hasOwnProperty(name); return providerCache.hasOwnProperty(name + providerSuffix) || cache.hasOwnProperty(name);
} }
...@@ -7870,8 +7873,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) { ...@@ -7870,8 +7873,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
afterTemplateChildLinkFn, afterTemplateChildLinkFn,
beforeTemplateCompileNode = $compileNode[0], beforeTemplateCompileNode = $compileNode[0],
origAsyncDirective = directives.shift(), origAsyncDirective = directives.shift(),
// The fact that we have to copy and patch the directive seems wrong! derivedSyncDirective = inherit(origAsyncDirective, {
derivedSyncDirective = extend({}, origAsyncDirective, {
templateUrl: null, transclude: null, replace: null, $$originalDirective: origAsyncDirective templateUrl: null, transclude: null, replace: null, $$originalDirective: origAsyncDirective
}), }),
templateUrl = (isFunction(origAsyncDirective.templateUrl)) templateUrl = (isFunction(origAsyncDirective.templateUrl))
...@@ -8324,6 +8326,8 @@ function removeComments(jqNodes) { ...@@ -8324,6 +8326,8 @@ function removeComments(jqNodes) {
return jqNodes; return jqNodes;
} }
var $controllerMinErr = minErr('$controller');
/** /**
* @ngdoc provider * @ngdoc provider
* @name $controllerProvider * @name $controllerProvider
...@@ -8411,7 +8415,12 @@ function $ControllerProvider() { ...@@ -8411,7 +8415,12 @@ function $ControllerProvider() {
} }
if (isString(expression)) { if (isString(expression)) {
match = expression.match(CNTRL_REG), match = expression.match(CNTRL_REG);
if (!match) {
throw $controllerMinErr('ctrlfmt',
"Badly formed controller string '{0}'. " +
"Must match `__name__ as __id__` or `__name__`.", expression);
}
constructor = match[1], constructor = match[1],
identifier = identifier || match[3]; identifier = identifier || match[3];
expression = controllers.hasOwnProperty(constructor) expression = controllers.hasOwnProperty(constructor)
...@@ -12336,6 +12345,11 @@ Parser.prototype = { ...@@ -12336,6 +12345,11 @@ Parser.prototype = {
? fn.apply(context, args) ? fn.apply(context, args)
: fn(args[0], args[1], args[2], args[3], args[4]); : fn(args[0], args[1], args[2], args[3], args[4]);
if (args) {
// Free-up the memory (arguments of the last function call).
args.length = 0;
}
return ensureSafeObject(v, expressionText); return ensureSafeObject(v, expressionText);
}; };
}, },
...@@ -13207,8 +13221,7 @@ function qFactory(nextTick, exceptionHandler) { ...@@ -13207,8 +13221,7 @@ function qFactory(nextTick, exceptionHandler) {
'qcycle', 'qcycle',
"Expected promise to be resolved with value other than itself '{0}'", "Expected promise to be resolved with value other than itself '{0}'",
val)); val));
} } else {
else {
this.$$resolve(val); this.$$resolve(val);
} }
...@@ -24551,10 +24564,11 @@ var NG_HIDE_IN_PROGRESS_CLASS = 'ng-hide-animate'; ...@@ -24551,10 +24564,11 @@ var NG_HIDE_IN_PROGRESS_CLASS = 'ng-hide-animate';
* *
* By default, the `.ng-hide` class will style the element with `display: none!important`. If you wish to change * By default, the `.ng-hide` class will style the element with `display: none!important`. If you wish to change
* the hide behavior with ngShow/ngHide then this can be achieved by restating the styles for the `.ng-hide` * the hide behavior with ngShow/ngHide then this can be achieved by restating the styles for the `.ng-hide`
* class in CSS: * class CSS. Note that the selector that needs to be used is actually `.ng-hide:not(.ng-hide-animate)` to cope
* with extra animation classes that can be added.
* *
* ```css * ```css
* .ng-hide { * .ng-hide:not(.ng-hide-animate) {
* /&#42; this is just another form of hiding an element &#42;/ * /&#42; this is just another form of hiding an element &#42;/
* display: block!important; * display: block!important;
* position: absolute; * position: absolute;
...@@ -26070,7 +26084,7 @@ var maxlengthDirective = function() { ...@@ -26070,7 +26084,7 @@ var maxlengthDirective = function() {
ctrl.$validate(); ctrl.$validate();
}); });
ctrl.$validators.maxlength = function(modelValue, viewValue) { ctrl.$validators.maxlength = function(modelValue, viewValue) {
return (maxlength < 0) || ctrl.$isEmpty(modelValue) || (viewValue.length <= maxlength); return (maxlength < 0) || ctrl.$isEmpty(viewValue) || (viewValue.length <= maxlength);
}; };
} }
}; };
......
{
"private": true,
"dependencies": {
"angular": "^1.3.12",
"todomvc-common": "^1.0.0",
"todomvc-app-css": "^1.0.1"
},
"devDependencies": {
"angular-mocks": "^1.3.12",
"angular-route": "^1.3.12"
}
}
...@@ -5,9 +5,9 @@ module.exports = function (config) { ...@@ -5,9 +5,9 @@ module.exports = function (config) {
basePath: '../../', basePath: '../../',
frameworks: ['jasmine'], frameworks: ['jasmine'],
files: [ files: [
'bower_components/angular/angular.js', 'node_modules/angular/angular.js',
'bower_components/angular-route/angular-route.js', 'node_modules/angular-route/angular-route.js',
'bower_components/angular-mocks/angular-mocks.js', 'node_modules/angular-mocks/angular-mocks.js',
'js/**/*.js', 'js/**/*.js',
'test/unit/**/*.js' 'test/unit/**/*.js'
], ],
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"author": "Pascal Hartig <phartig@rdrei.net>", "author": "Pascal Hartig <phartig@rdrei.net>",
"version": "1.0.0", "version": "1.0.0",
"devDependencies": { "devDependencies": {
"karma": "~0.10.0" "karma": "^0.10.0"
}, },
"scripts": { "scripts": {
"test": "karma start config/karma.conf.js" "test": "karma start config/karma.conf.js"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment