diff --git a/docs/config/templates/ngdoc/lib/methods.template.html b/docs/config/templates/ngdoc/lib/methods.template.html index 9f449f97cfba..ea9218a568b7 100644 --- a/docs/config/templates/ngdoc/lib/methods.template.html +++ b/docs/config/templates/ngdoc/lib/methods.template.html @@ -17,7 +17,7 @@

Parameters

{% endif %} {% if method.this %} -

Method's {% code %}this{% endcode %}

+

Method's `this`

{$ method.this | marked $} {% endif %} diff --git a/docs/config/templates/ngdoc/lib/this.template.html b/docs/config/templates/ngdoc/lib/this.template.html index 24881972b561..1829c1b374d6 100644 --- a/docs/config/templates/ngdoc/lib/this.template.html +++ b/docs/config/templates/ngdoc/lib/this.template.html @@ -1,4 +1,4 @@ {% if doc.this %} -

Method's {% code %}this{% endcode %}

+

Method's `this`

{$ doc.this | marked $} -{% endif %} \ No newline at end of file +{% endif %} diff --git a/i18n/ucd/src/extract.js b/i18n/ucd/src/extract.js index ae8493fd2b74..bc6736597d77 100644 --- a/i18n/ucd/src/extract.js +++ b/i18n/ucd/src/extract.js @@ -20,7 +20,7 @@ function main() { } catch (e) { fs.mkdirSync(__dirname + '/../../../src/ngParseExt'); } - fs.writeFile(__dirname + '/../../../src/ngParseExt/ucd.js', code); + fs.writeFileSync(__dirname + '/../../../src/ngParseExt/ucd.js', code); } } diff --git a/package.json b/package.json index b674a91bcaa0..1e25cc44728e 100644 --- a/package.json +++ b/package.json @@ -99,6 +99,11 @@ "stringmap": "^0.2.2" }, "dependencies": {}, + "resolutions": { + "//1": "`natives@1.1.0` does not work with Node.js 10.x on Windows 10", + "//2": "(E.g. see https://github.com/gulpjs/gulp/issues/2162.)", + "natives": "1.1.3" + }, "commitplease": { "style": "angular", "nohook": true diff --git a/test/ng/compileSpec.js b/test/ng/compileSpec.js index 48b5e565e088..2dd80560509c 100644 --- a/test/ng/compileSpec.js +++ b/test/ng/compileSpec.js @@ -11703,37 +11703,37 @@ describe('$compile', function() { // All interpolations are disallowed. $rootScope.onClickJs = ''; expect(function() { - $compile(''); }).toThrowMinErr( '$compile', 'nodomevents', 'Interpolations for HTML DOM event attributes are disallowed'); expect(function() { - $compile(''); }).toThrowMinErr( '$compile', 'nodomevents', 'Interpolations for HTML DOM event attributes are disallowed'); expect(function() { - $compile(''); }).toThrowMinErr( '$compile', 'nodomevents', 'Interpolations for HTML DOM event attributes are disallowed'); expect(function() { - $compile(''); }).toThrowMinErr( '$compile', 'nodomevents', 'Interpolations for HTML DOM event attributes are disallowed'); })); it('should pass through arbitrary values on onXYZ event attributes that contain a hyphen', inject(function($compile, $rootScope) { - element = $compile('')($rootScope); $rootScope.onClickJs = 'javascript:doSomething()'; $rootScope.$apply(); expect(element.attr('on-click')).toEqual('javascript:doSomething()'); })); it('should pass through arbitrary values on "on" and "data-on" attributes', inject(function($compile, $rootScope) { - element = $compile('')($rootScope); $rootScope.dataOnVar = 'data-on text'; $rootScope.$apply(); expect(element.attr('data-on')).toEqual('data-on text'); - element = $compile('')($rootScope); $rootScope.onVar = 'on text'; $rootScope.$apply(); expect(element.attr('on')).toEqual('on text'); diff --git a/test/ng/ngOnSpec.js b/test/ng/ngOnSpec.js index 9da918e881c2..30dd92778392 100644 --- a/test/ng/ngOnSpec.js +++ b/test/ng/ngOnSpec.js @@ -155,4 +155,34 @@ describe('ngOn* event binding', function() { expect(attrs.$attr.ngOnTitle).toBe('ng-on-title'); }); }); + + it('should correctly bind to kebab-cased event names', inject(function($compile, $rootScope) { + var element = $compile('')($rootScope); + var cb = $rootScope.cb = jasmine.createSpy('ng-on cb'); + $rootScope.$digest(); + + element.triggerHandler('foobar'); + element.triggerHandler('fooBar'); + element.triggerHandler('foo_bar'); + element.triggerHandler('foo:bar'); + expect(cb).not.toHaveBeenCalled(); + + element.triggerHandler('foo-bar'); + expect(cb).toHaveBeenCalled(); + })); + + it('should correctly bind to camelCased event names', inject(function($compile, $rootScope) { + var element = $compile('')($rootScope); + var cb = $rootScope.cb = jasmine.createSpy('ng-on cb'); + $rootScope.$digest(); + + element.triggerHandler('foobar'); + element.triggerHandler('foo-bar'); + element.triggerHandler('foo_bar'); + element.triggerHandler('foo:bar'); + expect(cb).not.toHaveBeenCalled(); + + element.triggerHandler('fooBar'); + expect(cb).toHaveBeenCalled(); + })); }); diff --git a/test/ng/ngPropSpec.js b/test/ng/ngPropSpec.js index 71bf67a5a5fb..9b4f9fab0637 100644 --- a/test/ng/ngPropSpec.js +++ b/test/ng/ngPropSpec.js @@ -147,11 +147,11 @@ describe('ngProp*', function() { it('should disallow property binding to onclick', inject(function($compile, $rootScope) { // All event prop bindings are disallowed. expect(function() { - $compile(''); }).toThrowMinErr( '$compile', 'nodomevents', 'Property bindings for HTML DOM event properties are disallowed'); expect(function() { - $compile(''); }).toThrowMinErr( '$compile', 'nodomevents', 'Property bindings for HTML DOM event properties are disallowed'); })); diff --git a/yarn.lock b/yarn.lock index 551675822fb2..268669168f1c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5750,10 +5750,10 @@ nanomatch@^1.2.9: snapdragon "^0.8.1" to-regex "^3.0.1" -natives@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/natives/-/natives-1.1.0.tgz#e9ff841418a6b2ec7a495e939984f78f163e6e31" - integrity sha1-6f+EFBimsux6SV6TmYT3jxY+bjE= +natives@1.1.3, natives@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/natives/-/natives-1.1.3.tgz#44a579be64507ea2d6ed1ca04a9415915cf75558" + integrity sha512-BZGSYV4YOLxzoTK73l0/s/0sH9l8SHs2ocReMH1f8JYSh5FUWu4ZrKCpJdRkWXV6HFR/pZDz7bwWOVAY07q77g== natural-compare@^1.4.0: version "1.4.0"