Skip to content

Commit

Permalink
fix(Navigation): clone navigation object to prevent mutation of original
Browse files Browse the repository at this point in the history
  • Loading branch information
deanterm authored and benjamincharity committed May 20, 2019
1 parent fbf1d5a commit 00fde32
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion terminus-ui/navigation/src/navigation.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ export class TsNavigationComponent implements OnInit, AfterViewInit {
*/
private setUpInitialArrays(items: TsNavigationItem[]): void {
// Clone the items and define the external flag for links only
const allItems = Array.from(items).map(item => {
const allItems = items.map(i => {
const item: TsNavigationItem = { ...i };
if (isLinkItem(item)) {
item.isExternal = this.isExternalLink(item.destination);
}
Expand Down

0 comments on commit 00fde32

Please sign in to comment.