Mostrando entradas con la etiqueta AngularJS. Mostrar todas las entradas
Mostrando entradas con la etiqueta AngularJS. Mostrar todas las entradas

01 febrero 2015

Ionic Framework: Don't reload controller on state change




This is due to the new Ionic Framework's Caching system:
By default, views are cached to improve performance. When a view is navigated away from, its element is left in the DOM, and its scope is disconnected from the $watch cycle. When navigating to a view that is already cached, its scope is then reconnected, and the existing element that was left in the DOM becomes the active view. This also allows for the scroll position of previous views to be maintained.

Solution 1: http://ionicframework.com/docs/api/directive/ionNavView/

Solution 2: https://github.com/angular-ui/ui-router/issues/582#issuecomment-68781282


19 agosto 2014

Activar CORS para $http en AngularJS

Habilitando CORS en Apache a través de .htaccess

Si al hacer un POST o GET con $http en AngularJS y se obtiene como respuesta un 'status 0', es porque el CORS está desactivado.

Para habilitar CORS, solo debemos incorporar una línea en el archivo .htaccess del directorio al cual vamos a acceder. En caso de que ese directorio no contenga un .htaccess, podemos crearlo con nuestro editor de texto favorito.
De cualquier forma lo abrimos y agregamos la siguiente línea:
Header add Access-Control-Allow-Origin "*"

Eso es todo.

Por razones de seguridad, se debe permitir el CORS sólo en el directorio donde se usará.