how to pass value of ViewBag
from view to a javascript file that is nothing but the angular controller module file?
I have a ViewBag
with data as
@ViewBag.Data
how to pass value of ViewBag
from view to a javascript file that is nothing but the angular controller module file?
I have a ViewBag
with data as
@ViewBag.Data
I gave an answer to your first question related to this here:
how to pass viewbag data from view to another component template that I call in this view
You can use hidden field with the value of @ViewBag.Data
, then you can access it on javascript document.getElementById("field_id").value