O'Reilly logo

Rails, Angular, Postgres, and Bootstrap, 2nd Edition by David B. Copeland

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Separating the App into Components

Angular intends for you to design your UI around components. Instead of one big page, you’re intended to create smaller, reusable or self-contained bits of HTML and code that can be pieced together. This is a common pattern in other JavaScript libraries, such as React,[77] and it’s a great way to organize complex user interfaces like our customer details page. This is different than the way Rails thinks of a UI, which is, instead, as a collection of HTML templates. You could think of partials as components, but partials are just a way to reuse HTML; there’s no behavior associated with them.

Let’s pick out the components from our existing UI. The following screen shows what it looked like at the end of Chapter ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required