diff --git a/Gruntfile.js b/Gruntfile.js index db263ea911bc..410ca100825b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -115,7 +115,7 @@ module.exports = function(grunt) { files: { src: 'test/**/*.js' }, }, ng: { - files: { src: files['angularSrc'] }, + files: { src: files['angularSrc'].concat('!src/angular.bind') }, }, ngAnimate: { files: { src: 'src/ngAnimate/**/*.js' }, diff --git a/angularFiles.js b/angularFiles.js index 3cc8d1ec70b7..006111c00b3c 100755 --- a/angularFiles.js +++ b/angularFiles.js @@ -76,7 +76,10 @@ var angularFiles = { 'src/ng/directive/script.js', 'src/ng/directive/select.js', 'src/ng/directive/style.js', - 'src/ng/directive/validators.js' + 'src/ng/directive/validators.js', + 'src/angular.bind', + 'src/publishExternalApis.js', + 'src/ngLocale/angular-locale_en-us.js' ], 'angularLoader': [ @@ -179,7 +182,6 @@ var angularFiles = { 'bower_components/jquery/dist/jquery.js', 'test/jquery_remove.js', '@angularSrc', - 'src/publishExternalApis.js', '@angularSrcModules', '@angularScenario', '@angularTest' @@ -188,7 +190,8 @@ var angularFiles = { 'karmaExclude': [ 'test/jquery_alias.js', 'src/angular-bootstrap.js', - 'src/ngScenario/angular-bootstrap.js' + 'src/ngScenario/angular-bootstrap.js', + 'src/angular.bind' ], 'karmaScenario': [ @@ -215,7 +218,6 @@ var angularFiles = { 'bower_components/jquery/dist/jquery.js', 'test/jquery_alias.js', '@angularSrc', - 'src/publishExternalApis.js', '@angularSrcModules', '@angularScenario', '@angularTest' @@ -224,7 +226,8 @@ var angularFiles = { 'karmaJqueryExclude': [ 'src/angular-bootstrap.js', 'src/ngScenario/angular-bootstrap.js', - 'test/jquery_remove.js' + 'test/jquery_remove.js', + 'src/angular.bind' ] }; diff --git a/src/AngularPublic.js b/src/AngularPublic.js index d608407f0ba7..78901de03cda 100644 --- a/src/AngularPublic.js +++ b/src/AngularPublic.js @@ -3,7 +3,6 @@ /* global angularModule: true, version: true, - $LocaleProvider, $CompileProvider, htmlAnchorDirective, @@ -151,11 +150,6 @@ function publishExternalAPI(angular) { }); angularModule = setupModuleLoader(window); - try { - angularModule('ngLocale'); - } catch (e) { - angularModule('ngLocale', []).provider('$locale', $LocaleProvider); - } angularModule('ng', ['ngLocale'], ['$provide', function ngModule($provide) { diff --git a/src/angular.bind b/src/angular.bind new file mode 100644 index 000000000000..33bc710d4342 --- /dev/null +++ b/src/angular.bind @@ -0,0 +1,10 @@ +if (window.angular.bootstrap) { + //AngularJS is already loaded, so we can return here... + console.log('WARNING: Tried to load angular more than once.'); + return; +} + +//try to bind to jquery now so that one can write jqLite(document).ready() +//but we will rebind on bootstrap again. +bindJQuery(); + diff --git a/src/angular.suffix b/src/angular.suffix index 4baa20e1b0b6..a79a3fb67841 100644 --- a/src/angular.suffix +++ b/src/angular.suffix @@ -1,15 +1,3 @@ - if (window.angular.bootstrap) { - //AngularJS is already loaded, so we can return here... - console.log('WARNING: Tried to load angular more than once.'); - return; - } - - //try to bind to jquery now so that one can write jqLite(document).ready() - //but we will rebind on bootstrap again. - bindJQuery(); - - publishExternalAPI(angular); - jqLite(document).ready(function() { angularInit(document, bootstrap); }); diff --git a/src/ng/locale.js b/src/ng/locale.js index 4a2d64c7a1db..ebe175f43132 100644 --- a/src/ng/locale.js +++ b/src/ng/locale.js @@ -10,72 +10,4 @@ * * * `id` – `{string}` – locale id formatted as `languageId-countryId` (e.g. `en-us`) */ -function $LocaleProvider() { - this.$get = function() { - return { - id: 'en-us', - NUMBER_FORMATS: { - DECIMAL_SEP: '.', - GROUP_SEP: ',', - PATTERNS: [ - { // Decimal Pattern - minInt: 1, - minFrac: 0, - maxFrac: 3, - posPre: '', - posSuf: '', - negPre: '-', - negSuf: '', - gSize: 3, - lgSize: 3 - },{ //Currency Pattern - minInt: 1, - minFrac: 2, - maxFrac: 2, - posPre: '\u00A4', - posSuf: '', - negPre: '-\u00A4', - negSuf: '', - gSize: 3, - lgSize: 3 - } - ], - CURRENCY_SYM: '$' - }, - - DATETIME_FORMATS: { - MONTH: - 'January,February,March,April,May,June,July,August,September,October,November,December' - .split(','), - SHORTMONTH: 'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec'.split(','), - DAY: 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday'.split(','), - SHORTDAY: 'Sun,Mon,Tue,Wed,Thu,Fri,Sat'.split(','), - AMPMS: ['AM','PM'], - medium: 'MMM d, y h:mm:ss a', - 'short': 'M/d/yy h:mm a', - fullDate: 'EEEE, MMMM d, y', - longDate: 'MMMM d, y', - mediumDate: 'MMM d, y', - shortDate: 'M/d/yy', - mediumTime: 'h:mm:ss a', - shortTime: 'h:mm a', - ERANAMES: [ - "Before Christ", - "Anno Domini" - ], - ERAS: [ - "BC", - "AD" - ] - }, - - pluralCat: function(num) { - if (num === 1) { - return 'one'; - } - return 'other'; - } - }; - }; -} diff --git a/test/ng/localeSpec.js b/test/ng/localeSpec.js index 1da9cf611062..a811de51fbad 100644 --- a/test/ng/localeSpec.js +++ b/test/ng/localeSpec.js @@ -3,7 +3,10 @@ describe('$locale', function() { /* global $LocaleProvider: false */ - var $locale = new $LocaleProvider().$get(); + var $locale; + beforeEach(inject(function(_$locale_) { + $locale = _$locale_; + })); it('should have locale id set to en-us', function() { expect($locale.id).toBe('en-us');