mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
34 lines
611 B
JavaScript
34 lines
611 B
JavaScript
angular.module('ionicApp', ['ionic'])
|
|
|
|
.controller('AppCtrl', function ($scope, $ionicModal) {
|
|
|
|
$scope.contacts = [
|
|
{
|
|
name: 'Gordon Freeman'
|
|
},
|
|
{
|
|
name: 'Barney Calhoun'
|
|
},
|
|
{
|
|
name: 'Lamarr the Headcrab'
|
|
},
|
|
];
|
|
$ionicModal.fromTemplateUrl('modal.html', function (modal) {
|
|
$scope.modal = modal;
|
|
}, {
|
|
animation: 'slide-in-up',
|
|
focusFirstInput: true
|
|
});
|
|
|
|
})
|
|
|
|
.controller('ModalCtrl', function ($scope) {
|
|
|
|
$scope.newUser = {};
|
|
|
|
$scope.createContact = function () {
|
|
console.log('Create Contact', $scope.newUser);
|
|
$scope.modal.hide();
|
|
};
|
|
|
|
}); |