Question: I want, my model in the controller, to be not a plain object like `Number`,`Boolean`,`String`, `Object`,`Array`, but an object created by function-constructor. 

Is it possible in AngularJS?

[Here](http://jsfiddle.net/Vc4df/) is my html:

```
<body ng-app="MyApp" ng-controller="MyController">
   <input ng-model="model.text" type="text"/>
</body>

```

and my script:

```
angular.module('MyApp',[]).
constant('MyModel',function(){
    var MyModel = function(text){
        this.text = text;
    };

    return MyModel;
}).
controller('MyController',
           [
               '$scope',
               'MyModel',
               function(
                   $scope,
                   MyModel
               ){
    //Does not work               
    $scope.model = new MyModel('dummy text');
    //Works
    //$scope.model = {text:'dummy text'};                   
}])

```

Answer: 
As stated [here](https://stackoverflow.com/questions/8387191/java-apns-apple-push-notification-service-error) java-apns is expecting the .p12 private key, not the .pem file. 

The instructions for creating a .p12 file on a mac are in the first link, but if you're using the openssl tool on linux you can create it with:

```
openssl pkcs12 -export -inkey mykey.key -in mykey.pem -out mykey.p12

```
I just found the answer. When I try to generate a P12 key, I need to select both, a private key and certificate in keychain access.

![enter image description here](https://i.stack.imgur.com/nabCa.png)