{
controller: ListController,
controllerAs: 'itemsList'
}
<div ng-repeat="item in itemsList.data">
<button ng-disabled="itemList.editing[item.id]"
ng-click="itemList.toggleEditMode(item)">Edit</button>
</div>
const style = {
header: { height: '50%' }
};
prepareStyle: function() {
let deviceHeight = ...; // Find API by yourself
let _style = _.merge({}, style);
if (style.header.height.substr(-1, 1) === '%')
_style.header.height = deviceHeight * (+style.header.height.slice(0, -1)) / 100;
return _style;
}
<div class="container" ng-controller="TestQuestions">
<div id="row" ng-repeat="question in questions">
<h4 class="page-header">{{question.id}}. {{question.question}}</h4>
<div ng-repeat="answer in question.answer">
<p></p>
<p></p>
<button type="button" class="btn btn-info" value="Input Button">{{answer}}</button>
</div>
</div>
</div>
.directive('customTag', function($parse) {
return {
require: '^ngModel', // Запрашиваю ng-model с parrent scope, так как, у этой свой локальный скоуп
restrict: 'E',
compile: function(el, attr) {
var input = angular.element('<input/>'); // далее создаю инпут элемент
el.replaceWith(input); // после чего меняю кастомный тег на созданный инпут
return function linking($scope, el, attr, ngModel) {
var type = $parse(attr.type)($scope); // Вот вам ваш тип
// ngModel - как я понима должна быть ссылка на модель
//
var mod = ngModel.$ViewValue;
el.attr('ng-model, mod) // поэтому создаем тег и добавляем туда наше значение из parent scope