I have a form that creates a new object with angularjs. The data is sent back under the name marker.
$scope.createMarker = function() {
$http.post('/markers/create', $scope.marker)
.success(function(data) {
})
.error(function(data) {
console.log('Error: ' + data);
});
};
So in my markers.ejs, I get the value back :
<input id="marker"> {{marker}} </input>
But I would like to get it directly in a javascript function :
console.log({{marker}})
Is it possible ?
For now I have the solution of stocking it into the input and get it with jquery:
<input id="marker" value="{{marker}}"> </input>
<script> console.log($("#marker").val()) </script>
But could we directly pass it into the js ?
Thanks for your help !