CORS API supporting Symfony3 + Angular2

Is your API giving you trouble with a missing Access-Control-Allow-Origin header error? Perhaps you enjoy living on the bleeding edge, and you’ve decided to build an app with Symfony3 + Anglar2 and you’ve seen this before? XMLHttpRequest cannot load http://myapp.dev. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:4000’ Read more…

Simulating a POST with DateTimeType to a Symfony3 Api with Forms and avoiding `Invalid value for this field`

When building an Api using Symfony3, you’ll be smart to process all input through Forms, and my strong recommendation is to do so via unique form classes for each Entity. However, when doing so with custom datetime fields, you’ll need to explicitly specify a format so you don’t waste countless Read more…

Angular + Symfony file upload with AWS S3

First, using the fantastic work of Jenny Louthan of Uncorked Studios, implement this directive: Directives.directive(‘fileModel’, [‘$parse’, function ($parse) { return { restrict: ‘A’, link: function(scope, element, attrs) { var model = $parse(attrs.fileModel); var modelSetter = model.assign; element.bind(‘change’, function(){ scope.$apply(function(){ modelSetter(scope, element[0].files[0]); }); }); } }; }]); Secondly, write the Angular function to handle Read more…