Skip to content

Instantly share code, notes, and snippets.

View javaeeeee's full-sized avatar

Dmitry Noranovich javaeeeee

View GitHub Profile
@javaeeeee
javaeeeee / index.html
Created February 5, 2017 19:04
Two HTML section each of which has its own controller.
<section ng-controller="HelloController">
<h4>AngularJS Greeting</h4>
<label for="name">Type your name here:</label>
<input id="name" type="text" ng-model="myModel">
<p>Hello {{myModel}}!</p>
</section>
<section ng-controller="GoodbyeController">
<h4>AngularJS Farewell</h4>
<label for="fName">Type your name here:</label>
<input id="fName" type="text" ng-model="myModel">
@javaeeeee
javaeeeee / goodbye.controller.js
Created February 5, 2017 19:01
An AngularJS controller to show that variables with the same name can exist in different scopes.
(function(){
angular.module('app')
.controller('GoodbyeController', GoodbyeController);
GoodbyeController.$inject = ['$scope'];
function GoodbyeController($scope){
$scope.myModel = 'Everyone';
}
})();
@javaeeeee
javaeeeee / karma.conf.js
Created January 30, 2017 13:54
List of files to load in the browser by Karma test runner
...
// list of files / patterns to load in the browser
files: [
'node_modules/angular/angular.js',
'node_modules/angular-mocks/angular-mocks.js',
'app/app.module.js',
'app/hello/hello.controller.js',
'app/hello/hello.controller.spec.js'
],
...
@javaeeeee
javaeeeee / hello.controller.spec.js
Created January 30, 2017 13:42
A Jasmine test spec for HelloController
describe('HelloController tests', function () {
var scope;
var HelloController;
beforeEach(function () {
module('app');
inject(function ($controller) {
scope = {};
HelloController = $controller('HelloController', { $scope: scope });
@javaeeeee
javaeeeee / app.module.js
Created January 24, 2017 18:33
New app.module file
(function () {
angular.module('app', []);
})();
@javaeeeee
javaeeeee / hello.controller.js
Created January 24, 2017 18:32
The file containing HelloController
(function () {
angular.module('app')
.controller('HelloController', HelloController);
HelloController.$inject = ['$scope'];
function HelloController($scope) {
$scope.myModel = 'World';
}
@javaeeeee
javaeeeee / karma.conf.js
Created January 24, 2017 17:51
Karma configuration file
// Karma configuration
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
// frameworks to use
@javaeeeee
javaeeeee / e2e.spec.js
Created January 13, 2017 21:50
AngularJS application end-to-end test
describe('Hello world', function () {
var message = 'AngularJS';
var input = element(by.model('myModel'));
beforeEach(function () {
browser.get('http://localhost:3000');
});
it('should have title', function () {
expect(browser.getTitle())
@javaeeeee
javaeeeee / protractor.conf.js
Created January 13, 2017 21:48
Protractor configuration file
exports.config = {
framework: 'jasmine',
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['e2e/e2e.spec.js']
};
@javaeeeee
javaeeeee / .eslintrc.js
Created January 13, 2017 21:43
ESLint settings to prevent it yelling in Jasmine spec files
module.exports = {
"extends": ["angular", "eslint:recommended"],
"plugins":["jasmine"],
"env":{
"jasmine":true,
"node":true
}
};