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
<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"> |
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
(function(){ | |
angular.module('app') | |
.controller('GoodbyeController', GoodbyeController); | |
GoodbyeController.$inject = ['$scope']; | |
function GoodbyeController($scope){ | |
$scope.myModel = 'Everyone'; | |
} | |
})(); |
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
... | |
// 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' | |
], | |
... |
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('HelloController tests', function () { | |
var scope; | |
var HelloController; | |
beforeEach(function () { | |
module('app'); | |
inject(function ($controller) { | |
scope = {}; | |
HelloController = $controller('HelloController', { $scope: scope }); |
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
(function () { | |
angular.module('app', []); | |
})(); |
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
(function () { | |
angular.module('app') | |
.controller('HelloController', HelloController); | |
HelloController.$inject = ['$scope']; | |
function HelloController($scope) { | |
$scope.myModel = 'World'; | |
} |
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
// 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 |
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('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()) |
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
exports.config = { | |
framework: 'jasmine', | |
seleniumAddress: 'http://localhost:4444/wd/hub', | |
specs: ['e2e/e2e.spec.js'] | |
}; |
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
module.exports = { | |
"extends": ["angular", "eslint:recommended"], | |
"plugins":["jasmine"], | |
"env":{ | |
"jasmine":true, | |
"node":true | |
} | |
}; |