Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$$areEqual method does not need special case for NaN checks #334

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e0c09a9
Preserving The Isolate Scope Directive
teropa Apr 11, 2015
ff6b5c1
Preserving Controller Directives
teropa Apr 27, 2015
f20d6ab
Basic Transclusion
teropa May 31, 2015
28a42e8
Transclusion and Scopes
teropa Jun 1, 2015
e80afc8
Transclusion from Descendant Nodes
teropa Jun 1, 2015
f6d4672
Transclusion in Controllers
teropa Jun 1, 2015
026067d
The Clone Attach Function
teropa Jun 3, 2015
d677f37
Transclusion with Template URLs
teropa Jun 4, 2015
419acbf
Transclusion with Multi-Element Directives
teropa Jun 4, 2015
6b824ed
The ngTransclude Directive
teropa Jun 4, 2015
15fc755
Full Element Transclusion
teropa Jun 5, 2015
ced66a3
Requiring Controllers from Transcluded Directives
teropa Jun 5, 2015
5c4c405
The $interpolate Service
teropa Jun 10, 2015
b6efdc9
Interpolating Strings
teropa Jun 11, 2015
9c5d105
Value Stringification
teropa Jun 11, 2015
05362d7
Supporting Escaped Interpolation Symbols
teropa Jun 11, 2015
80f9c85
Skipping Interpolation When There Are No Expressions
teropa Jun 11, 2015
56b84af
Text Node Interpolation
teropa Jun 11, 2015
7aa5268
Attribute Interpolation
teropa Jun 11, 2015
803d5a5
Optimizing Interpolation Watches With A Watch Delegate
teropa Jun 11, 2015
9bfb6f7
Making Interpolation Symbols Configurable
teropa Jun 15, 2015
bdc3c42
The ngClick Directive
teropa Nov 4, 2015
30c6bd8
Bootstrapping Angular Applications Manually
teropa Nov 4, 2015
115086e
Bootstrapping Angular Applications Automatically
teropa Nov 4, 2015
b885864
Building The Production Bundle
teropa Nov 4, 2015
16f7db6
Example App
teropa Nov 5, 2015
39055c6
$$areEqual method does not need special case for NaN checks
abdulapopoola May 15, 2016
aa8521b
Update scope.js
abdulapopoola May 15, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules/
.DS_Store
myangular.js
myangular.min.js
10 changes: 10 additions & 0 deletions example-app/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
angular.module('myExampleApp', [])
.controller('ExampleController', function() {
this.counter = 1;
this.increment = function() {
this.counter++;
};
this.decrement = function() {
this.counter--;
};
});
14 changes: 14 additions & 0 deletions example-app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
</head>
<body ng-app="myExampleApp">
<div ng-controller="ExampleController as ctrl">
{{ctrl.counter}}
<button ng-click="ctrl.increment()">+</button>
<button ng-click="ctrl.decrement()">-</button>
</div>
<script src="../myangular.js"></script>
<script src="app.js"></script>
</body>
</html>
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@
"karma-phantomjs-launcher": "^1.0.0",
"phantomjs-prebuilt": "^2.1.7",
"sinon": "^1.17.2",
"watchify": "^3.7.0"
"watchify": "^3.7.0",
"uglifyjs": "^2.4.10"
},
"dependencies": {
"jquery": "^2.1.4",
"lodash": "^4.11.1"
},
"scripts": {
"lint": "jshint src test",
"test": "karma start"
"test": "karma start",
"build": "browserify src/bootstrap.js > myangular.js",
"build:minified": "browserify src/bootstrap.js | uglifyjs -mc > myangular.min.js"
}
}
3 changes: 3 additions & 0 deletions src/angular_public.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ function publishExternalAPI() {
ngModule.provider('$httpParamSerializerJQLike', require('./http').$HttpParamSerializerJQLikeProvider);
ngModule.provider('$compile', require('./compile'));
ngModule.provider('$controller', require('./controller'));
ngModule.provider('$interpolate', require('./interpolate'));
ngModule.directive('ngController', require('./directives/ng_controller'));
ngModule.directive('ngTransclude', require('./directives/ng_transclude'));
ngModule.directive('ngClick', require('./directives/ng_click'));
}

module.exports = publishExternalAPI;
52 changes: 52 additions & 0 deletions src/bootstrap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
'use strict';

var $ = require('jquery');
var _ = require('lodash');
var publishExternalAPI = require('./angular_public');
var createInjector = require('./injector');

publishExternalAPI();

window.angular.bootstrap = function(element, modules, config) {
var $element = $(element);
modules = modules || [];
config = config || {};
modules.unshift(['$provide', function($provide) {
$provide.value('$rootElement', $element);
}]);
modules.unshift('ng');
var injector = createInjector(modules, config.strictDi);
$element.data('$injector', injector);
injector.invoke(['$compile', '$rootScope', function($compile, $rootScope) {
$rootScope.$apply(function() {
$compile($element)($rootScope);
});
}]);
return injector;
};

var ngAttrPrefixes = ['ng-', 'data-ng-', 'ng:', 'x-ng-'];
$(document).ready(function() {
var foundAppElement, foundModule, config = {};
_.forEach(ngAttrPrefixes, function(prefix) {
var attrName = prefix + 'app';
var selector = '[' + attrName.replace(':', '\\:') + ']';
var element;
if (!foundAppElement &&
(element = document.querySelector(selector))) {
foundAppElement = element;
foundModule = element.getAttribute(attrName);
}
});
if (foundAppElement) {
config.strictDi = _.some(ngAttrPrefixes, function(prefix) {
var attrName = prefix + 'strict-di';
return foundAppElement.hasAttribute(attrName);
});
window.angular.bootstrap(
foundAppElement,
foundModule ? [foundModule] : [],
config
);
}
});
Loading