diff --git a/content/blog/dom-pollution-why-i-prefer-vue-over-angular/index.md b/content/blog/dom-pollution-why-i-prefer-vue-over-angular/index.md index 21f50871..ce9325e3 100644 --- a/content/blog/dom-pollution-why-i-prefer-vue-over-angular/index.md +++ b/content/blog/dom-pollution-why-i-prefer-vue-over-angular/index.md @@ -1,7 +1,7 @@ --- { - title: 'DOM Pollution, Why I prefer Vue over Angular', - description: 'See why not all frontend SPA frameworks render the same and what you need to be aware of when using Angular', + title: 'Why I prefer Vue over Angular: DOM Pollution', + description: 'Angular differs from Vue in some keys ways, including its "Incremental rendering". This shift introduces something I call "DOM Pollution"; its why I prefer Vue over Angular.', published: '2022-05-24T22:07:20.000Z', edited: '2022-05-24T22:07:20.000Z', authors: ['splatkillwill'], @@ -24,109 +24,35 @@ With a renderer like the one used by Angular, breaking down your UI into reusabl To illustrate, take the following example in Vue: -```html - -``` - -Which can produce: - -![HTML table with rows and columns](./Capture1.JPG) + Then if you tried the same in Angular: -```html -
-

- John Hammond No Expense Report -

- - - Category - Amount - - - Dinosaurs - - - - Park - - - - IT - - - -
-``` - -![HTML table with rows and columns messed up](./Capture2.JPG) + What happened? Lets compare the custom components. -MyTextCell.vue -```vue - - - -``` +`MyTextCell.vue` + -text-cell.component.ts -```ts -import { Component } from "@angular/core"; - -@Component({ - selector: "my-text-cell", - template: ` - - - - `, - styles: [ - ` - td { - border: 1px solid black; - text-align: left; - } - ` - ] -}) -export class MyTextCellComponent { -} -``` +`text-cell.component.ts` + They both look like they are just wrapping table detail (cell) tags but they render completely diffrent.