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 @@
<head>
<meta charset="utf-8">
<title>AngularJS • TodoMVC</title>
<link rel="stylesheet" href="bower_components/todomvc-common/base.css">
<link rel="stylesheet" href="bower_components/todomvc-app-css/index.css">
<link rel="stylesheet" href="node_modules/todomvc-common/base.css">
<link rel="stylesheet" href="node_modules/todomvc-app-css/index.css">
<style>[ng-cloak] { display: none; }</style>
</head>
<body ng-app="todomvc">
......@@ -63,9 +63,9 @@
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
</footer>
</script>
<script src="bower_components/todomvc-common/base.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script>
<script src="node_modules/todomvc-common/base.js"></script>
<script src="node_modules/angular/angular.js"></script>
<script src="node_modules/angular-route/angular-route.js"></script>
<script src="js/app.js"></script>
<script src="js/controllers/todoCtrl.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
* License: MIT
*/
......@@ -482,21 +482,15 @@ function $RouteProvider() {
* definitions will be interpolated into the location's path, while
* 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) {
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);
$location.path(interpolate(this.current.$$route.originalPath, newParams));
$location.search(angular.extend({}, $location.search(), searchParams));
}
else {
// interpolate modifies newParams, only query params are left
$location.search(newParams);
} else {
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
* License: MIT
*/
......@@ -54,7 +54,7 @@ function minErr(module, ErrorConstructor) {
return match;
});
message = message + '\nhttp://errors.angularjs.org/1.3.11/' +
message = message + '\nhttp://errors.angularjs.org/1.3.12/' +
(module ? module + '/' : '') + code;
for (i = 2; i < arguments.length; i++) {
message = message + (i == 2 ? '?' : '&') + 'p' + (i - 2) + '=' +
......@@ -381,8 +381,7 @@ function nextUid() {
function setHashKey(obj, h) {
if (h) {
obj.$$hashKey = h;
}
else {
} else {
delete obj.$$hashKey;
}
}
......@@ -691,7 +690,7 @@ function isElement(node) {
function makeMap(str) {
var obj = {}, items = str.split(","), i;
for (i = 0; i < items.length; i++)
obj[ items[i] ] = true;
obj[items[i]] = true;
return obj;
}
......@@ -1472,8 +1471,12 @@ function bootstrap(element, modules, config) {
forEach(extraModules, function(module) {
modules.push(module);
});
doBootstrap();
return doBootstrap();
};
if (isFunction(angular.resumeDeferredBootstrap)) {
angular.resumeDeferredBootstrap();
}
}
/**
......@@ -2118,11 +2121,11 @@ function toDebugString(obj) {
* - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
*/
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
minor: 3,
dot: 11,
codeName: 'spiffy-manatee'
dot: 12,
codeName: 'outlandish-knitting'
};
......@@ -4157,7 +4160,7 @@ function createInjector(modulesToLoad, strictDi) {
}
var args = [],
$inject = annotate(fn, strictDi, serviceName),
$inject = createInjector.$$annotate(fn, strictDi, serviceName),
length, i,
key;
......@@ -4196,7 +4199,7 @@ function createInjector(modulesToLoad, strictDi) {
invoke: invoke,
instantiate: instantiate,
get: getService,
annotate: annotate,
annotate: createInjector.$$annotate,
has: function(name) {
return providerCache.hasOwnProperty(name + providerSuffix) || cache.hasOwnProperty(name);
}
......@@ -7870,8 +7873,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
afterTemplateChildLinkFn,
beforeTemplateCompileNode = $compileNode[0],
origAsyncDirective = directives.shift(),
// The fact that we have to copy and patch the directive seems wrong!
derivedSyncDirective = extend({}, origAsyncDirective, {
derivedSyncDirective = inherit(origAsyncDirective, {
templateUrl: null, transclude: null, replace: null, $$originalDirective: origAsyncDirective
}),
templateUrl = (isFunction(origAsyncDirective.templateUrl))
......@@ -8324,6 +8326,8 @@ function removeComments(jqNodes) {
return jqNodes;
}
var $controllerMinErr = minErr('$controller');
/**
* @ngdoc provider
* @name $controllerProvider
......@@ -8411,7 +8415,12 @@ function $ControllerProvider() {
}
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],
identifier = identifier || match[3];
expression = controllers.hasOwnProperty(constructor)
......@@ -12336,6 +12345,11 @@ Parser.prototype = {
? fn.apply(context, args)
: 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);
};
},
......@@ -13207,8 +13221,7 @@ function qFactory(nextTick, exceptionHandler) {
'qcycle',
"Expected promise to be resolved with value other than itself '{0}'",
val));
}
else {
} else {
this.$$resolve(val);
}
......@@ -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
* 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
* .ng-hide {
* .ng-hide:not(.ng-hide-animate) {
* /&#42; this is just another form of hiding an element &#42;/
* display: block!important;
* position: absolute;
......@@ -26070,7 +26084,7 @@ var maxlengthDirective = function() {
ctrl.$validate();
});
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) {
basePath: '../../',
frameworks: ['jasmine'],
files: [
'bower_components/angular/angular.js',
'bower_components/angular-route/angular-route.js',
'bower_components/angular-mocks/angular-mocks.js',
'node_modules/angular/angular.js',
'node_modules/angular-route/angular-route.js',
'node_modules/angular-mocks/angular-mocks.js',
'js/**/*.js',
'test/unit/**/*.js'
],
......
......@@ -4,7 +4,7 @@
"author": "Pascal Hartig <phartig@rdrei.net>",
"version": "1.0.0",
"devDependencies": {
"karma": "~0.10.0"
"karma": "^0.10.0"
},
"scripts": {
"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