Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 810a3e4

Browse files
NoHomeygkalpak
authored andcommitted
docs(CHANGELOG.md): add language ids to code blocks for syntax highlighting
Add missing language identifiers to code blocks used as examples, in order to have proper syntax highlighting. Fixes #15356 Closes #15357
1 parent fc3e489 commit 810a3e4

File tree

1 file changed

+29
-27
lines changed

1 file changed

+29
-27
lines changed

CHANGELOG.md

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ To migrate the code follow the examples below:
101101

102102
BEFORE:
103103

104-
```
104+
```js
105105
/* 1 */
106106
elem.data('my-key', 2);
107107
elem.data('myKey', 3);
@@ -119,7 +119,7 @@ elem.data('foo-bar'); // 1
119119

120120
AFTER:
121121

122-
```
122+
```js
123123
/* 1 */
124124
// Rename one of the keys as they would now map to the same data slot.
125125
elem.data('my-key', 2);
@@ -152,7 +152,7 @@ Before:
152152

153153
HTML:
154154

155-
```
155+
```html
156156
// All five versions used to be equivalent.
157157
<div ng-style={background_color: 'blue'}></div>
158158
<div ng-style={'background:color': 'blue'}></div>
@@ -163,7 +163,7 @@ HTML:
163163

164164
JS:
165165

166-
```
166+
```js
167167
// All five versions used to be equivalent.
168168
elem.css('background_color', 'blue');
169169
elem.css('background:color', 'blue');
@@ -183,15 +183,15 @@ After:
183183

184184
HTML:
185185

186-
```
186+
```html
187187
// Previous five versions are no longer equivalent but these two still are.
188188
<div ng-style={'background-color': 'blue'}></div>
189189
<div ng-style={backgroundColor: 'blue'}></div>
190190
```
191191

192192
JS:
193193

194-
```
194+
```js
195195
// Previous five versions are no longer equivalent but these two still are.
196196
elem.css('background-color', 'blue');
197197
elem.css('backgroundColor', 'blue');
@@ -212,19 +212,19 @@ To migrate the code follow the example below:
212212

213213
Before:
214214

215-
```
215+
```js
216216
elem.attr(booleanAttrName, '');
217217
```
218218

219219
After:
220220

221-
```
221+
```js
222222
elem.attr(booleanAttrName, false);
223223
```
224224

225225
or:
226226

227-
```
227+
```js
228228
elem.attr(booleanAttrName, null);
229229
```
230230

@@ -238,13 +238,13 @@ To migrate the code follow the example below:
238238

239239
Before:
240240

241-
```
241+
```js
242242
elem.attr(attributeName, null);
243243
```
244244

245245
After:
246246

247-
```
247+
```js
248248
elem.attr(attributeName, "null");
249249
```
250250

@@ -260,7 +260,7 @@ Before:
260260

261261
HTML:
262262

263-
```
263+
```html
264264
<select multiple>
265265
<option>value 1</option>
266266
<option>value 2</option>
@@ -269,7 +269,7 @@ HTML:
269269

270270
JavaScript:
271271

272-
```
272+
```js
273273
var value = $element.val();
274274
if (value) {
275275
/* do something */
@@ -280,7 +280,7 @@ After:
280280

281281
HTML:
282282

283-
```
283+
```html
284284
<select multiple>
285285
<option>value 1</option>
286286
<option>value 2</option>
@@ -289,7 +289,7 @@ HTML:
289289

290290
JavaScript:
291291

292-
```
292+
```js
293293
var value = $element.val();
294294
if (value.length > 0) {
295295
/* do something */
@@ -326,12 +326,14 @@ NgModelController and FormController methods without context.
326326

327327
For example
328328

329-
`$scope.$watch('something', myNgModelCtrl.$render)`
329+
```js
330+
$scope.$watch('something', myNgModelCtrl.$render)
331+
```
330332

331333
will no longer work because the `$render` method is passed without any context.
332334
This must now be replaced with
333335

334-
```
336+
```js
335337
$scope.$watch('something', function() {
336338
myNgModelCtrl.$render();
337339
})
@@ -490,14 +492,14 @@ the `$http.defaults.jsonpCallbackParam` property, which is `"callback"` by defau
490492

491493
Before this change:
492494

493-
```
495+
```js
494496
$http.json('trusted/url?callback=JSON_CALLBACK');
495497
$http.json('other/trusted/url', {params: {cb:'JSON_CALLBACK'}});
496498
```
497499

498500
After this change:
499501

500-
```
502+
```js
501503
$http.json('trusted/url');
502504
$http.json('other/trusted/url', {jsonpCallbackParam:'cb'});
503505
```
@@ -512,13 +514,13 @@ method.**
512514

513515
You configure this list in a module configuration block:
514516

515-
```
517+
```js
516518
appModule.config(['$sceDelegateProvider', function($sceDelegateProvider) {
517519
$sceDelegateProvider.resourceUrlWhiteList([
518520
// Allow same origin resource loads.
519521
'self',
520522
// Allow JSONP calls that match this pattern
521-
'https://some.dataserver.com/**.jsonp?**`
523+
'https://some.dataserver.com/**.jsonp?**'
522524
]);
523525
}]);
524526
```
@@ -529,7 +531,7 @@ method**
529531
You can pass a trusted object instead of a string as a URL to the `$http`
530532
service:
531533

532-
```
534+
```js
533535
var promise = $http.jsonp($sce.trustAsResourceUrl(url));
534536
```
535537

@@ -600,7 +602,7 @@ property in the `ngModelOptions` to prevent it from inheriting from the ancestor
600602

601603
For example if you had the following HTML:
602604

603-
```
605+
```html
604606
<form ng-model-options="{updateOn: 'blur'}">
605607
<input ng-model="...">
606608
</form>
@@ -611,7 +613,7 @@ After this change the input will inherit the option to update on blur.
611613
If you want the original behaviour then you will need to specify the option
612614
on the input as well:
613615

614-
```
616+
```html
615617
<form ng-model-options="{updateOn: 'blur'}">
616618
<input ng-model="..." ng-model-options="{updateOn: 'default'}">
617619
</form>
@@ -754,14 +756,14 @@ A common cases where stray white-space can cause problems is when
754756
attribute values are compared, for example in an $observer:
755757

756758
Before:
757-
```
759+
```js
758760
$attrs.$observe('myAttr', function(newVal) {
759761
if (newVal === 'false') ...
760762
});
761763
```
762764

763765
To migrate, the attribute value should be trimmed manually:
764-
```
766+
```js
765767
$attrs.$observe('myAttr', function(newVal) {
766768
if (newVal.trim() === 'false') ...
767769
});
@@ -1049,7 +1051,7 @@ a "!" prefix. For example, rather than `mydomain.com/#/a/b/c` will become
10491051
If you actually wanted to have no hash-prefix then you should configure
10501052
this by adding a configuration block to you application:
10511053

1052-
```
1054+
```js
10531055
appModule.config(['$locationProvider', function($locationProvider) {
10541056
$locationProvider.hashPrefix('');
10551057
}]);

0 commit comments

Comments
 (0)