This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.factory('MyHTTPInterceptor', function($q) { | |
return { | |
// On response success | |
response: function (response) { | |
console.log(response); | |
// Return the response or promise. | |
return response || $q.when(response); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div ng-app="twitterApp"> | |
<div ng-controller="AppCtrl"> | |
<div enter="deleteTweets()">Roll over to load more tweets</div> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://henriquat.re/directives/advanced-directives-combining-angular-with-existing-components-and-jquery/angularAndJquery.html | |
http://www.yearofmoo.com/2013/05/enhanced-animations-in-angularjs.html#daneden-animate-css-integration | |
http://blog.thousandeyes.com/creating-extensible-widgets-part-1-jquery-to-angularjs/ | |
http://codingsmackdown.tv/blog/2012/12/28/mocking-promises-in-unit-tests/ | |
http://blog.brunoscopelliti.com/angularjs-promise-or-dealing-with-asynchronous-requests-in-angularjs | |
http://markdalgleish.com/2013/06/using-promises-in-angularjs-views/ | |
http://www.codeproject.com/Articles/637430/Angular-js-example-application | |
https://github.com/dylanfprice/angular-gm | |
http://nadeemkhedr.wordpress.com/2013/10/18/angularjs-good-unit-test-structure-for-controllers/ | |
http://weblogs.asp.net/dwahlin/archive/2013/05/22/dynamically-loading-controllers-and-views-with-angularjs-and-requirejs.aspx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<highchart value="chartData" type="line" width="800" height="400"> | |
</highchart> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(['angular', | |
'directives/directives', | |
'directives/expander-directive'], function() { | |
describe("expander directives", function() { | |
var element, scope; | |
beforeEach(function() { | |
module('directives'); | |
module('views/expander.html'); | |
inject(function($compile, $rootScope) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FOR /L %%A in (1, 1, 10) DO ( | |
curl -H "Content-Type:application/json" -H "Accept: application/json" -X POST \ | |
-d @request.json http://host:port/action.do -v -L \ | |
--cookie "key=value" -i | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Calling $q.when takes a promise or any other type, if it is not a promise then it will wrap it in a promise and call resolve. If you pass a value to it then it is never going to be rejected. | |
From the docs: | |
Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = angular.module('MyApp'); | |
app.controller('ContactController', ['$scope', function($scope) { | |
$scope.contacts = ["juntao", "abruzzi"]; | |
$scope.submit = function() { | |
$scope.$parent.toggleContactsPanel(); | |
}; | |
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(['controllers/controllers', | |
'services/search-setting-service'], function(controllers) { | |
controllers.controller('SearchSettingController', | |
['$scope', 'SearchSettingService', function($scope, SearchSettingService) { | |
SearchSettingService.setting().then(function(setting) { | |
$scope.setting = setting; | |
$scope.currentVendor = setting.vendors[0]; | |
}); | |
}]); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe("index page", function() { | |
beforeEach(function() { | |
browser.get("http://localhost:9999/app/index.html"); | |
}); | |
it("should have navigator", function() { | |
expect(element("#navigator")).toBeDefined(); | |
}); | |
it("should have input box", function() { |
OlderNewer