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('app', []); | |
app.controller('test', ['$scope', function($scope){ | |
// some code | |
}]); |
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('app', []); | |
app.service('some-service', function(){…}); |
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.controller('some-controller', ['$scope', 'some-service'], function(scope, service){ | |
// code… | |
}]); |
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('app', []); | |
app.service('some-service', ['$location', function($location){ | |
// code… | |
}]); |
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('testing the circle-service', function(){ | |
// code… | |
}); |
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 service; | |
beforeEach(inject(function($injector){ | |
service = $injector.get('circle-service'); | |
})); |
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
<form> | |
<label>User name:</label> | |
<input name='userName' type='text'/> | |
<br> | |
<label>Password:</label> | |
<input name='password' type='password'/> | |
<br> | |
<button>Submit</button> | |
</form> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Angular Form Sample</title> | |
</head> | |
<body ng-app> | |
<div> | |
<form name='loginForm' novalidate> | |
<label>User name:</label> | |
<input type='text' ng-model='login.userName' required/> |
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
<form name='loginForm' novalidate> | |
<label>User name:</label> | |
<input name='userName' type='text' ng-model='login.userName' required/> | |
<span>Valid: {{loginForm.userName.$valid}}</span> | |
<br> | |
<label>Password:</label> | |
<input name='password' type='password' ng-model='login.password' required/> | |
<span>Valid: {{loginForm.password.$valid}}</span> | |
<br> | |
<button>Login</button> |
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
<label>User name:</label> | |
<input name='userName' type='text' ng-model='login.userName' required/> | |
<span>Valid: {{loginForm.userName.$valid}}</span> | |
<div ng-hide='loginForm.userName.$valid' class='error'> | |
Must enter user name.</div> |
OlderNewer