You can use the mechanism of the
prototype.
.when('/someUrl', {
template : ' ng-template="some.html">
You can use the mechanism of the
prototype.
.when('/someUrl', {
template : ' ng-template="some.html">
Now wherever you
want to use
' ng-controller="MyController">
you
need to ensure that there pr.data in the Scope of the calling controller. As an example
uib-modal
var modalInstance =
$modal.open({
animation: true,
templateUrl:
'modal.html',
resolve: {
data: ['Service', function (Service)
{
return Service.getData();
}]
},
controller: function ($scope, $modalInstance, data) {
var pr =
this;
pr.data = data;
pr.ok = function () {
$modalInstance.close();
};
},
controllerAs:'pr',
size:'sm'
});
modal.html
type="text/ng-template" id="modal.html">
class="modal-body">
ng-controller="MyController">
And
now you can use $scope.data = $scope.pr.data; in
MyController
pr.data is my style. You can rewrite the code
without PR.
the basic principle of working with ng-controller described in
this video rel="nofollow">https://egghead.io/lessons/angularjs-the-dot
I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print ...
No comments:
Post a Comment