! !
, , , angular UI-,
.state('app.monimes', {
url: "/monimes",
views: {
'menuContent' :{
templateUrl: "templates/monimes.html",
controller: 'sampleCtrl'
}
}
})
/***
*
* .
*/
.controller('sampleCtrl',['$scope','sampleService', function($scope, $sampleService) {
$scope.username="em";
$scope.$watch('username', function(newUsername) {
$scope.log(newUsername);
$sampleService.events(newUsername)
.success(function(data, status, headers) {
$scope.events = data.data;
});
},true);
}
]);
<div>
<label for="username">Type in a GitHub username</label>
<input type="text" ng-model="username" placeholder="Enter a GitHub username, like a user" />
<pre ng-show="username">{{ events }}</pre>
</div>
.
ng-controller="sampleCtrl"
div : D
, , .
source
share