Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var fitnessApp = angular.module('fitnessApp', [ 'ngResource','ui.router' ]);
fitnessApp.config(function($stateProvider){
$stateProvider.state('new', {
url: '/new?portfolioId',
templateUrl: 'index.html',
controller: function($scope, $stateParams) {
$scope.portfolioId = $stateParams.portfolioId;
$scope.id = $stateParams.portfolioId;
console.log($stateParams.portfolioId);
console.log("Noooo");
alert("fooo");
}
});
})
fitnessApp.controller('FitnessController', ['$scope', '$http', function($scope, $http) {
var json;
var url = "https://raw.githubusercontent.com/hhirsch/fitness_log_json/master/fitness.json";
$http({
url: url,
method: "GET"
}).success(function(data, status, headers, config) {
$scope.strengths = data['strength'];
$scope.name = data['name'];
}).error(function(data, status, headers, config) {
$scope.status = status;
});
$scope.foo = "bar";
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.