Last active
August 29, 2015 14:02
-
-
Save kurai021/2f6c8f6e0adc5fef0aed to your computer and use it in GitHub Desktop.
Problema con Angular.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
<!-- tengo esto escrito en mi index.html--> | |
<div ng-switch on="page"> | |
<div ng-switch-when="home"> | |
<div ng-include="'views/home.html'"></div> | |
</div> | |
<div ng-switch-when="charts"> | |
<div ng-include="'views/charts.html'"></div> | |
</div> | |
</div> | |
<!-- mi controlador es bastante simple--> | |
angular.module('BTCviewer', []) | |
.controller('BTCviewer_controller',['$scope', function($scope){ | |
$scope.page = 'home'; | |
}]); | |
<!-- en mi views/home.html--> | |
... | |
<ul role="tablist" data-item="2" class="bottom"> | |
<li id="panel1" role="tab"> | |
<button id="%charts" ng-click="page='charts'">Charts</button> | |
</li> | |
... | |
</ul> | |
<!-- tengo algo similar en views/charts.html--> | |
.... | |
<button id="%charts" ng-click="page='home'">Charts</button> | |
... | |
<!-- quiero cambiar mis vistas desde un boton dentro de las mismas, logro hacerlo si el boton estuviera en el index.html y fuera del ng-switch on="page", pero no si esta dentro de mis vistas--> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment