totaljs / framework

Node.js framework
http://www.totaljs.com
Other
4.36k stars 450 forks source link

include file in page lost model in layout #599

Closed bkhurram closed 6 years ago

bkhurram commented 6 years ago

Hii, When i include a file in page with submodel parameter @{view('/test/inc/stripe', model.objtwo)} then lost other model in layout. When i include a file in page without model @{view('/test/inc/stripe')} then give an exception.

Work only when i include with param @{view('/test/inc/stripe', model)}

see this example-project: https://github.com/bkhurram/totaljs-test

http://localhost:8000/test1/ http://localhost:8000/test2/ http://localhost:8000/test3/

Thanks, Khurram

petersirka commented 6 years ago

Hi, model is not shared with layout. You need to use repository.

Model vs Repository

bkhurram commented 6 years ago

okay then layout see a model parameter it's wrong.