javascript - Combine Angular and Blade expressions -


i'm using laravel , angular , wondering if it's possible , how can combine both laravel , angular expressions?

for example if have route has parameter need angular variable:

data-ng-click="myfunction({{ url::route("myroute", [<% myobj.id %>]); }})" 

where <% %> changed angular open/close expression tags , {{}} blades open/close expression tags.

it won't work.

blade code(php) run server-side , angular(js) run on client side. meaning blade code always executed before angular code while code requires blade execute after angular.

if change expression blade required run before angular, work.

but, end lots of spaghetti code way. blade , angular different technologies. not intermix them unless extremely necessary. , make sure comment reasons .


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -