Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <html lang="pt-br">
	<meta charset="UTF-8">
	<title>Aprenda AngularJS - Formulário de Pedido</title>

	<link href="|Open+Sans:400,700" rel="stylesheet">

	<!-- Arquivo CSS principal -->
	<link rel="stylesheet" href="style.css">

	<!--[if lt IE 9]>
		<script src=""></script>


<!-- Declare uma nova aplicação AngularJS e associe o controlador -->
<body ng-app ng-controller="OrderFormController">
			<!-- Percorre o array 'services', atribuindo um manipulador click, e defini ou remove a classe css "active" se necessário -->
			<li ng-repeat="service in services" ng-click="toggleActive(service)" ng-class="{ }">
				<!-- Note o uso do 'current filter', que vai formatar o preço -->
				{{ }} <span>{{ service.price | currency: "R$ " }}</span>

		<div class="total">
			<!-- Calcule o preço total de todas as escolhas de serviços. Formate isso como moeda -->
			Total: <span>{{ total() | currency:"R$ " }}</span>


	<!-- Include AngularJS from Google's CDN -->
	<script src=""></script>
	<script src="script.js"></script>


	Simples RESET


	Estilos Gerais

body {
	font: 15px/1.3 'Open Sans', sans-serif;
	color: #5E5B64;
	text-align: center;

a, a:visited {
	outline: none;
	color: #389DC1;

a:hover {
	text-decoration: none;

section, footer, header, aside, nav {
	display: block;

	Formulário de Pedido

form {
	background-color: #61A1BC;
	border-radius: 2px;
	box-shadow: 0 1px 1px #CCC;
	width: 400px;
	padding: 35px 60px;
	margin: 80px auto; 

form h1 {
	color: #FFF;
	font-size: 64px;
	font-family: 'Cookie', cursive;
	font-weight: normal;
	line-height: 1;
	text-shadow: 0 3px 0 rgba(0,0,0,0.1);

form ul {
	list-style: none;
	color: #FFF;
	font-size: 20px;
	font-weight: bold;
	text-align: left;
	margin: 20px 0 15px;

form ul li {
	padding: 20px 30px;
	background-color: #E35885;
	margin-bottom: 8px;
	box-shadow: 0 1px 1px rgba(0,0,0,0.1);
	cursor: pointer;

form ul li span {
	float: right;

form ul {
	background-color: #8EC16D;
} {
	border-top: 1px solid rgba(255, 255, 255, 0.5);
	padding: 15px 30px;
	font-size: 20px;
	font-weight: bold;
	text-align: left;
	color: #FFF;
} span {



                function OrderFormController ($scope) {

	// Defina o modelo de propriedades. O View vai fazer o loop
	// através do array services e gerar um elemento li
	// para cada um dos itens.

	$ = [
			name: 'Desenvolvimento Web',
			price: 3000,
			active: true
		}, {
			name: 'Design',
			price: 2000,
			active: false
		}, {
			name: 'Integração',
			price: 2500,
			active: false
		}, {
			name: 'Treinamento',
			price: 2200,
			active: false

	$scope.toggleActive = function (s) { = !;	

	// Método útil para calcular o preço total
	$ = function () {

		var total = 0;

		// Uso o método auxiliar do Angular 'forEach'
		// para iterar o array services

		angular.forEach ($, function (s) {
			if ( {
				total += s.price;

		return total;