Although the answer has been accepted, I would like to explain it more thoroughly. According to the official documentation, ng-init can accept any expression. This means that you can achieve your desired outcome as long as the associated scope includes a function named init() or directly assigns the initial value.
It is important to note that ngInit should be used judiciously in templates. There are only a few legitimate uses for ngInit, such as aliasing special properties in ngRepeat or injecting data from server-side scripts. In most cases, it is recommended to use controllers instead of ngInit for initializing values in a scope.
Therefore, it is advisable to initialize variables when the controller is created without relying on ng-init. Here is an example:
var myApp = angular.module('myApp', []);
myApp.controller('myController', ['$scope', function($scope){
$scope.init = function() {
$scope.textLetterSize = 14;
};
// runs once per controller instantiation
$scope.init();
}]);