frontend
Convert a 3D model to JSON with Three.JS library
Problem
Converting a given 3D model (a .obj file) to JSON format
Solution
Three js has its own converter now
requirements
The converted location in source code
https://github.com/mrdoob/three.js/tree/dev/utils/converters
How to set selected="selected" in VueJS
Problem: I have a select element. The options are populated using an array and while populating the select element I want to also set the selected value. How do I do this.
Solution
use v-bind:se;ected OR :selected with a boolean expression that returns TRUE or FALSE. If it returns TRUE that will be the selected value. See example below
Vue JS Cookie not set in Request Headers
Problem:
I was just learning VueJS and wrote a method to get some JSON data but I noticed that the current session of the user was not sent with the call. My code is as follows
Creating a proxy for your frontend application using NGINX
Problem
You have frontend application using a web service to get resources and is running on a gulp/grunt server.
Issues are:
- You will come across CORS errors
- You will have no userfriendly URLS (you will have something like localhost:9090).
How to get rid of these problems?
Easy, just use a NGINX proxy. Here is how
Assumptions:
Enable Outside In experience in your Drupal 8 site
You might have seen the new users experience that Drupal 8 provides. Its provides on the fly block placement and menu configuration. The new experience is called "The outside in experience". Read more about it here. SO however if you are wondering how you can get hands on experience you need to do the following.
Pre-requisites:
You will need to update to Drupal 8.2.0
Modules to enable:
Place Blocks module
Passing data within your controllers
/** * Created by nmeegama on 8/27/16. */ /************ Controller to set the data *******************/ (function (angular) { 'use strict'; angular.module('MyApp').controller('SetDataCtrl', [ '$scope', 'MyService', function ($scope, MyService) { $scope.setData = function (data) { MyService.setData(data); }; }]); })(angular); /************ Controller to get the data *******************/ (function (angular) { 'use strict'; angular.module('MyApp').controller('GetDataCtrl', [ '$scope',