rsms / raster

Raster — simple CSS grid system
https://rsms.me/raster/
MIT License
810 stars 43 forks source link

Using Raster Grid in an Angular app #11

Open jb9474 opened 4 years ago

jb9474 commented 4 years ago

mega noob incoming.

Im hacking my way around angular and raster grid then made the foolish error of trying to include the .css files in an angular component and the 'r-cell' etc html in the template. this throws up all kind of errors, and im starting to learn why.

Has anyone successfully incorporated raster grid into an angular app please?

Do the 'r-cell' 'r-grid' etc elements need to be declared in angular via Angular Elements?

Many thanks, would be good to use raster in my little angular project.

Jeremy slonch.com

jb9474 commented 4 years ago

ok ok

dug more and it hopefully looks pretty simple:

schemas: [ CUSTOM_ELEMENTS_SCHEMA ] needed in @NgModule

https://stackoverflow.com/questions/39428132/custom-elements-schema-added-to-ngmodule-schemas-still-showing-error

hope this helps anyone with a similar intention.

nice work Rasmus!

Londeren commented 4 years ago

You can also create custom components like this

@Component({
  selector: 'r-cell',
  template: '<ng-content></ng-content>',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class GridColComponent implements OnInit {
  @Input() span: any;
}
jb9474 commented 4 years ago

thanks @Londeren will give that a go to!