Server-side require #498

Closed
qwe2 opened this Issue Nov 24, 2015 · 2 comments

Comments

Projects
None yet
3 participants
@qwe2
Contributor

qwe2 commented Nov 24, 2015

RequireAttribute only works when including client-side code. It would be nice to have something similar on the server-side too when I don't have an explicit client-side control but just want to include resources.

@Tarmil Tarmil closed this in db7c46f Dec 2, 2015

@JorgeVV

This comment has been minimized.

Show comment
Hide comment
@JorgeVV

JorgeVV Sep 6, 2017

@Tarmil Example of this? Don't know what to do with the Web.Require<'resourceT> instance.

Edit: This seems to be the way (Lost the article/post/comment where I read it)

let bootstrap = Doc.WebControl(new Web.Require<Resources.Bootstrap>())
let body : Doc list = // ...
let bodyWithResource = bootstrap :: body 

JorgeVV commented Sep 6, 2017

@Tarmil Example of this? Don't know what to do with the Web.Require<'resourceT> instance.

Edit: This seems to be the way (Lost the article/post/comment where I read it)

let bootstrap = Doc.WebControl(new Web.Require<Resources.Bootstrap>())
let body : Doc list = // ...
let bodyWithResource = bootstrap :: body 
@Tarmil

This comment has been minimized.

Show comment
Hide comment
@Tarmil

Tarmil Sep 12, 2017

Member

@JorgeVV Indeed, that is the way to go. I added a section about it in the documentation.

Member

Tarmil commented Sep 12, 2017

@JorgeVV Indeed, that is the way to go. I added a section about it in the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment