Created
April 11, 2014 01:05
-
-
Save empirefx/10435405 to your computer and use it in GitHub Desktop.
AngularJS easy way..
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 data-ng-app="prueba"> | |
<meta charset="utf-8"/> | |
<head> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.10/angular.min.js"></script> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.10/angular-route.js"></script> | |
<script type="text/javascript"> | |
var probando = angular.module("prueba", ['ngRoute']); | |
probando.config(function($routeProvider) { | |
$routeProvider | |
.when('/', | |
{ | |
controller:'ListCtrl', | |
templateUrl:'items.html' | |
}) | |
.otherwise({redirectTo:'/'}); | |
}); | |
probando.controller('ListCtrl', function($scope) { | |
//$scope.message = '...'; | |
}); | |
</script> | |
</head> | |
<body> | |
<h2>Prueba</h2> | |
<div data-ng-view="">Vista aqui..</div> | |
</body> | |
</html> |
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
<h1>Items</h1> | |
<p>Cargado <i>items.html</i></p> | |
<script type="text/javascript"> | |
alert('Hola!'); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment