@@ -20,9 +20,9 @@ which drives many of these changes.
20
20
# Migrate from 1.4 to 1.5
21
21
22
22
Angular 1.5 takes a big step towards preparing developers for a smoother transition to Angular 2 in
23
- the future. Architecturing your applications using components, making use of lifecycle hooks in
24
- directive controllers and relying on native ES6 features (such as classes and arrow functions) are
25
- now all possible with Angular 1.5.
23
+ the future. Architecturing your applications using components, multi-slot transclusion, using
24
+ lifecycle hooks in directive controllers and relying on native ES6 features (such as classes and
25
+ arrow functions) are now all possible with Angular 1.5.
26
26
27
27
28
28
This release includes numerous bug and security fixes, as well as performance improvements to core
@@ -38,8 +38,11 @@ Among them, a few stand out:
38
38
style of architecture).
39
39
* Multi-slot transclusion: Enabling the design of more powerful and complex UI elements with a much
40
40
simpler configuration and reduced boilerplate.
41
+ * `$onInit` lifecycle hook: Introducing a new lifecycle hook for directive controllers, called after
42
+ all required controllers have been constructed. This enables access to required controllers from
43
+ a directive's controller, without having to rely on the linking function.
41
44
* `ngAnimateSwap`: A new directive in `ngAnimate`, making it super easy to create rotating
42
- banner-like components
45
+ banner-like components.
43
46
* Testing helpers: New helper functions in `ngMock`, simplifying testing for animations, component
44
47
controllers and routing.
45
48
@@ -153,13 +156,55 @@ the `$sanitize` service will now remove instances of the `<use>` tag from the co
153
156
This element is used to import external SVG resources, which is a security risk as the `$sanitize`
154
157
service does not have access to the resource in order to sanitize it.
155
158
159
+ Similarly, due to [234053fc](https://github.com/angular/angular.js/commit/234053fc9ad90e0d05be7e8359c6af66be94c094),
160
+ the `$sanitize` service will now also remove instances of the `usemap` attribute from any elements
161
+ passedto it. This attribute is used to reference another element by `name` or `id`. Since the `name`
162
+ and `id` attributes are already blacklisted, a sanitized `usemap` attribute could only reference
163
+ unsanitized content, which is a security risk.
164
+
156
165
Due to [98c2db7f](https://github.com/angular/angular.js/commit/98c2db7f9c2d078a408576e722407d518c7ee10a),
157
166
passing a non-string value (other than `undefined` or `null`) through the `linky` filter will throw
158
167
an error. This is not expected to have any significant impact on applications, since the input was
159
168
always assumed to be of type 'string', so passing non-string values never worked correctly anyway.
160
169
The main difference is that now it will fail faster and with a more informative error message.
161
170
162
171
172
+ ## ngTouch (`ngClick`)
173
+
174
+ Due to [0dfc1dfe](https://github.com/angular/angular.js/commit/0dfc1dfebf26af7f951f301c4e3848ac46f05d7f),
175
+ the `ngClick` override directive from the `ngTouch` module is **deprecated and disabled by default**.
176
+ This means that on touch-based devices, users might now experience a 300ms delay before a click
177
+ event is fired.
178
+
179
+ If you rely on this directive, you can still enable it using
180
+ `$touchProvider.ngClickOverrideEnabled()`:
181
+
182
+ ```js
183
+ angular.module('myApp').config(function($touchProvider) {
184
+ $touchProvider.ngClickOverrideEnabled(true);
185
+ });
186
+ ```
187
+
188
+ Going forward, we recommend using [FastClick](https://github.com/ftlabs/fastclick) or perhaps one of
189
+ the [Angular 3rd party touch-related modules](http://ngmodules.org/tags/touch) that provide similar
190
+ functionality.
191
+
192
+ Also note that modern browsers already remove the 300ms delay under some circumstances:
193
+
194
+ - **Chrome and Firefox for Android** remove the 300ms delay when the well-known
195
+ `<meta name="viewport" content="width=device-width">` is set.
196
+ - **Internet Explorer** removes the delay, when the `touch-action` css property is set to `none` or
197
+ `manipulation`.
198
+ - Since **iOS 8, Safari** removes the delay on so-called "slow taps".
199
+
200
+ For more info on the topic, you can take a look at this
201
+ [article by Telerik](http://developer.telerik.com/featured/300-ms-click-delay-ios-8/).
202
+
203
+ <div class="alert alert-warning">
204
+ **Note:** This change does **not** affect the `ngSwipe` directive.
205
+ </div>
206
+
207
+
163
208
164
209
165
210
0 commit comments