# Breaking Changes A list of the breaking changes introduced in Ionic Angular v4. - [Dynamic Mode](#dynamic-mode) - [Button](#button) - [Chip](#chip) - [FAB](#fab) - [Fixed Content](#fixed-content) - [Icon](#icon) - [Item](#item) - [Option](#option) - [Segment](#segment) - [Toolbar](#toolbar) - [Sass](#sass) ## Dynamic Mode Components are no longer able to have their mode changed dynamically. You can change the mode before the first render, but after that it will not style properly because only the initial mode's styles are included. ## Button ### Markup Changed Button should now be written as an `` element. Ionic will determine when to render an anchor tag based on the presence of an `href` attribute. **Old Usage Example:** ```html Default Anchor ``` **New Usage Example:** ```html Default Button Default Anchor ``` ### Icon Attributes Renamed Previously to style icons inside of a button the following attributes were used: `icon-left`, `icon-right`, (and with the added support of RTL) `icon-start`, `icon-end`. These have been renamed to the following, and moved from the button element to the icon itself: | Old Property | New Property | Property Behavior | |---------------------------|----------------|-----------------------------------------------------------------------| | `icon-left`, `icon-start` | `slot="start"` | Positions to the left of the button in LTR, and to the right in RTL. | | `icon-right`, `icon-end` | `slot="end"` | Positions to the right of the button in LTR, and to the left in RTL. | **Old Usage Example:** ```html Icon Left Icon Left on LTR, Right on RTL Icon Right Icon Right on LTR, Left on RTL ``` **New Usage Example:** ```html Icon Left on LTR, Right on RTL Icon Right on LTR, Left on RTL ``` ## Chip ### Markup Changed Buttons inside of an `` container should now be written as an `` element. Ionic will determine when to render an anchor tag based on the presence of an `href` attribute. **Old Usage Example:** ```html Default ``` **New Usage Example:** ```html Default ``` ## FAB ### Markup Changed Buttons inside of an `` container should now be written as an `` element. Ionic will determine when to render an anchor tag based on the presence of an `href` attribute. **Old Usage Example:** ```html ``` **New Usage Example:** ```html ``` ### Fixed Content The `` container was previously placed inside of the fixed content by default. Now, any fixed content should go inside of the `` container. **Old Usage Example:** ```html Scrollable Content ``` **New Usage Example:** ```html Scrollable Content ``` ## Icon ### Fonts Removed Icons have been refactored to use SVGs instead of fonts. Ionic will only fetch the SVG for the icon when it is needed, instead of having a large font file that is always loaded in. If any `CSS` is being overridden for an icon it will need to change to override the SVG itself. Below is a usage example of the differences in changing the icon color. **Old Usage Example:** ```css .icon { color: #000; } ``` **New Usage Example:** ```css .icon { fill: #000; } ``` ## Item ### Markup Changed Item should now be written as an `` element. Ionic will determine when to render an anchor tag based on the presence of an `href` attribute, and a button tag based on the presence of a click. Otherwise, it will render a div. **Old Usage Example:** ```html Default Item Anchor Item ``` **New Usage Example:** ```html Default Item Button Item Anchor Item ``` ### Label Required Previously an `ion-label` would automatically get added to an `ion-item` if one wasn't provided. Now an `ion-label` should always be added if the item is used to display text. ```html Item Label ``` ### Attributes Renamed Previously to position elements inside of an `ion-item` the following attributes were used: `item-left`, `item-right`, (and with the added support of RTL) `item-start`, `item-end`. These have been renamed to the following: | Old Property | New Property | Property Behavior | |---------------------------|----------------|---------------------------------------------------------------------| | `item-left`, `item-start` | `slot="start"` | Positions to the left of the item in LTR, and to the right in RTL. | | `item-right`, `item-end` | `slot="end"` | Positions to the right of the item in LTR, and to the left in RTL. | **Old Usage Example:** ```html
Left
Item Label
Right
Left on LTR, Right on RTL
Item Label
Right on LTR, Left on RTL
``` **New Usage Example:** ```html
Left on LTR, Right on RTL
Item Label
Right on LTR, Left on RTL
``` ## Option ### Markup Changed Select's option element should now be written as ``. This makes it more obvious that the element should only be used with a Select. **Old Usage Example:** ```html Option 1 Option 2 Option 3 ``` **New Usage Example:** ```html Option 1 Option 2 Option 3 ``` ### Class Changed The class has been renamed from `Option` to `SelectOption` to keep it consistent with the element tag name. ## Segment The markup hasn't changed for Segments, but now writing `` will render a native button element inside of it. ## Toolbar ### Attributes Renamed The attributes to position an `ion-buttons` element inside of a toolbar have been renamed, as well as the behavior attached to the name. We noticed there was some confusion behind the behavior of the `start` and `end` attributes, and with the new support for RTL we wanted to make the behavior of these match RTL. In order to do this we had to rename the old `start`/`end` to something that makes more sense with their behavior. The names and behavior of each of the properties was previously: | Old Property | Property Behavior | |--------------|--------------------------------------------------------------------------------------------------------------| | `start` | Positions element to the left of the content in `ios` mode, and directly to the right in `md` and `wp` mode. | | `end` | Positions element to the right of the content in `ios` mode, and to the far right in `md` and `wp` mode. | | `left` | Positions element to the left of all other elements. | | `right` | Positions element to the right of all other elements. | The properties have been renamed to the following: | Old Property | New Property | Property Behavior | |--------------|---------------------|------------------------------------------------------------------------------------------------------------------| | `start` | `slot="mode-start"` | Positions element to the `left` of the content in `ios` mode, and directly to the `right` in `md` and `wp` mode. | | `end` | `slot="mode-end"` | Positions element to the `right` of the content in `ios` mode, and to the far right in `md` and `wp` mode. | | `left` | `slot="start"` | Positions element to the `left` of all other elements in `LTR`, and to the `right` in `RTL`. | | `right` | `slot="end"` | Positions element to the `right` of all other elements in `LTR`, and to the `left` in `RTL`. | ## Sass ### Deprecated Styles Deprecated variables and styles have been removed. - [e0a29db](https://github.com/ionic-team/ionic/commit/e0a29db) - TODO continue to add what is removed here