Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where should my template start and where should it end? #12

Closed
elieobeid7 opened this issue Jan 29, 2019 · 2 comments
Closed

Where should my template start and where should it end? #12

elieobeid7 opened this issue Jan 29, 2019 · 2 comments

Comments

@elieobeid7
Copy link

I read this issue

#3

And since It seams that I can only serve one file, index.html and load the other files inside it using ajax, I want to create a single angular app, Because I don't know VueJS nor react and writing too much ajax is messy, Angular is clean, you compile it, all you have is an index.html, perfect to be used in WUY. I have two problems though

  • I keep reading the templates in the example you've given, some are missing <html> tag, others are missing <body> tag, does wuy auto generate them, or can I use angular? Because if wuy auto generates parts some html tags, I wouldn't be able to use Angular

  • I need to use the server module right?

@manatlan
Copy link
Owner

There are many things in your comment.

First : wuy doesn't modify your HTML ! The only thing : it will try to inject a <script src="wuy.js"> (the magic) only if you didn't include it.

You said "the templates in the example you've given, some are missing html tag, others are missing body tag" : in many example : I don't respect the html tags : I've just put the minimal ones (don't wanted to overbloat the examples) !

Second : yes ... you could try to use angular. wuy is not affiliated to one js framework. In my examples : I mainly use vuejs, because I'm confident with it. And I use another python lib (vbuild) to package the result in one html. vbuild is not linked with wuy. You can use any other python webpacker.
I've made a lot of angular in the past (1 & >1) : In fact : it depends on how you want to make it.

  • You use your tool (nodejs) to webpack your html. You put it in the web folder : and wuy just send it back.
  • You try to override the wuy._render() : to use your tool (or find a python one), to render your angular app in live.

"I need to use the server module right?"

no ... choosing between server or window mode should just depends on your need.

  • window/app mode : is for making a GUI app (server & client on the same host) ... reusing a chrome in "app mode".
  • server mode : is for making a web app (server can be on a host, and you can have many clients on other hosts) ... clients can be in any browser.

@elieobeid7
Copy link
Author

Thanks for clarifying that for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants