So I am messing with the tabs template and using browsrify so I can use NPM modules. I am trying to use the randomuser NPM module (although any module that has to connect with with a URL will have the same result).
My controller pretty much looks like this:
angular.module('starter.controllers', [])
.controller('DashCtrl', function($scope, $http) {
$scope.somethingHappens = function() {
var RandomUser = require('randomuser');
var r = new RandomUser();
r.getUsers(function (data) {
$scope.results = data[0]['user']['email'];
console.log(data);
});
};
in the view (tab-dash.html), I have the ion-content tag with ng-controller=“DashCtrl” (like normal). and I have :
<div class="list card">
<div class="item item-body"><button type="button" ng-click="somethingHappens()">Click here</button></div>
<ion-list>
<div class="item item-body">
{{results}}<br/>
</div>
</ion-list>
</div>
When I browserify the app and build, the button appears, but when i click, nothing happens. I’m lost.