Skip to content

Instantly share code, notes, and snippets.

@aliencode
Created October 5, 2013 05:43
Show Gist options
  • Save aliencode/6837156 to your computer and use it in GitHub Desktop.
Save aliencode/6837156 to your computer and use it in GitHub Desktop.
angularJS一些

##$q的使用

var q = $q.defer(),
    p = q.promise;

chrome.fileSystem.chooseEntry({type: "openWritableFile", accepts: [
        {extensions: ["md"]}
    ]},
    function (entry) {

        q.resolve(entry.fullPath);

    });

p.then(function (greeting) {
    $scope.setMsg(greeting, 1000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment