I am using Angular routing and want to access a php session variable in the view.
<?php
session_start();
//print_r($_SESSION['query']); the variable is available and will print here
?>
<script>
var x = <?$_SESSION['query']?>
console.log("x: " , x) //this returns undefined
</script>
I'm trying to pass the session variable as a parameter in function, but it is not available here either.
ng-init="mc.makeQuery(<?($_SESSION['query'])?>)"