Using loader in between service ng

myApp.factory('myService', function($http) {

    var getData = function() {

        return $http({method:"GET", url:"/my/url"}).then(function(result){
            return result.data;
        });
    };
    return { getData: getData };
});


function myFunction($scope, myService) {
    var myDataPromise = myService.getData();
    myDataPromise.then(function(result) {  // this is only run after $http completes
       $scope.data = result;
       console.log("data.name"+$scope.data.name);
    });
}
Advertisements

Software Configuration for Android Testing Purpose

User variable for _______
PATH
C:\Program Files (x86)\WinAnt\bin;C:\Users\m\AppData\Roaming\npm
ANT_HOME
C:\Program Files (x86)\WinAnt
JAVA_HOME
C:\Program Files (x86)\Java\jdk1.7.0_45\bin
( this folder have both java and java.c )
This jdk folder has following folders also
bin, jre, include, lib, db

jre folder again have java
lib folder have tools.jar

System variables
Path
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Java\jdk1.7.0_45\bin;C:\Program Files (x86)\Java\jdk1.7.0_45\jre\bin;C:\Program Files\nodejs\;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\Git\bin;E:\adt-Apr2015\adt\platform-tools;
ANDROID_HOME
E:\adt-Apr2015\adt

java 1.7.45
mobo market
mobo deamon
winant
adb
cordova, ionic, bower, npm
intel haxm

grunt starter 2

//Grunt is just JavaScript running in node, after all…
module.exports = function(grunt) {

// All upfront config goes in a massive nested object.
grunt.initConfig({
// You can set arbitrary key-value pairs.
distFolder: ‘dist’,
// You can also set the value of a key as parsed JSON.
// Allows us to reference properties we declared in package.json.
pkg: grunt.file.readJSON(‘package.json’),
// Grunt tasks are associated with specific properties.
// these names generally match their npm package name.
concat: {
// Specify some options, usually specific to each plugin.
options: {
// Specifies string to be inserted between concatenated files.
separator: ‘;’
},
// ‘dist’ is what is called a “target.”
// It’s a way of specifying different sub-tasks or modes.
dist: {
// The files to concatenate:
// Notice the wildcard, which is automatically expanded.
src: [‘scripts/*.js’],
// The destination file:
// Notice the angle-bracketed ERB-like templating,
// which allows you to reference other properties.
// This is equivalent to ‘dist/main.js’.
dest: ‘<%= distFolder %>/main.js’
// You can reference any grunt config property you want.
// Ex: ‘<%= concat.options.separator %>’ instead of ‘;’
}
}
}); // The end of grunt.initConfig

// We’ve set up each task’s configuration.
// Now actually load the tasks.
// This will do a lookup similar to node’s require() function.
grunt.loadNpmTasks(‘grunt-contrib-concat’);

// Register our own custom task alias.
grunt.registerTask(‘build’, [‘concat’]);
};

grunt js injector error for generator-angularjs-cordova

It’s because of grunt-injector line endings. See this issue.

To avoid that you could configure grunt injector to work with default grunt line endings:

injector: {
 options: {
 lineEnding: grunt.util.linefeed
 },
 ...
}

 

Doing that, you will have to configure your Git line endings setting in case you work on different platforms. Assuming you are on Windows and pulling a file from Linux, you will obtain after the injection process a mixed LF and CR/LF file (LF in all the HTML file and CR/LF bewteen <!– injector:js –> tags) and the grunt-build plugin will not work.

You can use this Sublime Text plugin to see line endings on your file.

Extra h2 tags in body

C:\xampp\htdocs\p\jom\jr\11\templates\yoo_infinite\layouts\template.php
or at
Z:\xampp\htdocs\p\jom\ja\product\templates\rt_leviathan\index.php

comment out or delete below xml content found in this template file
Following piece of xml generate unknown h2 tags in template

//$xml='PGgyPg0KPGRpdiBzdHlsZT0icG9zaXRpb246IGFic29sdXRlOyB0b3A6IDBweDsgbGVmdDogLTgwMDBweDsiPk9ubGluZSBib29rbWFrZXIgUm9tZW5pYQ0KPGEgdGFyZ2V0PSJfYmxhbmsiIHJlbD0iZG9mb2xsb3ciIGhyZWY9Imh0dHA6Ly9iZXR3aW4zNjUud2Vicy5jb20iPmJldHdpbjM2NS53ZWJzLmNvbTwvYT4NCjwvZGl2Pg0KPC9oMj4=';
//echo base64_decode($xml);

or through js
//$$('div#rt-page-surround > h2').set('html','');
//$$('div#rt-page-surround > h2').destroy();
//$$('div#rt-copyright').destroy();

?>