Show by window mockeados data

1

I'm trying to show some data mockeados (removed from an API) to show them by window and I'm a little lost.

This HTML does an include of another HTML that is where the call is made to the services part, in this case the mockeados data that I put below to show them by window.

HTML

<div>
                                <!-- Características de la vivienda -->
                                <ap-resumen-hogar-box class="div triple"
                                    title="Características de la vivienda"
                                    model="apResumenHogar.datosVivienda">
                                </ap-resumen-hogar-box>

                                <!-- Medidas de Seguridad -->
                                <ap-resumen-hogar-box class="div triple"
                                    title="Medidas de seguridad"
                                    model="apResumenHogar.datosMedidasSeguridad">
                                </ap-resumen-hogar-box>
</div>

in a JS I have the call to the data mockeados, in which when I make the call to a part of them appears correctly the data (Name and address of the person), but I try to call said data Mockeados to show by window said data from another HTML and honestly I do not know how to do it

Moke data in the JS

vm.preconcedidos = [ {
"caracteristicasRiesgo" : {
                  "name" : "CaracteristicasViviendaRest",
                  "codigoTipoVivienda" : "PI",
                  "codigoSubTipoVivienda" : "PI",
                  "codigoUbicacionVivienda" : "NU",
                  "codigoRegimenVivienda" : "PO",
                  "anioConstruccion" : 1977,
                  "viviendaHabitual" : true,
                  "hipotecada" : false,
                  "metrosVivienda" : 107,
                  "metrosTerrazas" : 0,
                  "metrosJardin" : 0,
                  "numeroGarajes" : 0,
                  "numeroPuertas" : 1,
                  "numeroHabitantes" : 1,
                  "medidasSeguridad" : {
                    "name" : "MedidasSeguridadRest",
                    "puertasBlindadas" : false,
                    "rejasFijas" : false,
                    "tieneAlarma" : false,
                    "vigilancia24h" : false,
                    "cajaFuerte" : false
                  },
                  "codigoUsoVivienda" : "RH"
                },
} ];

In this other HTML is where the data of Characteristics of the house, Security Measures etc ... are loaded.

HTML 2

<article class="module boxShadowPanel opened bigMode preventBottomPaddingInContent">

    <div class="clearfix">
        <h4 class="title">
            <!-- {{ctrl.title}} -->
            Características de la vivienda
        </h4>
        <div class="actions ">
            <!-- <a class="textActionLink semiStrong actionsLinkOnPhone editIconOnPhones">
                Modificar
            </a> -->
            <span class="collapseTrigger strong show-on-phones actionsLinkOnPhone textActionLink fl"
                ng-click="field.showBoxes = !field.showBoxes">
                <span class="arrowIcon microArrow topArrow"
                    ng-class="{
                        'topArrow': field.showBoxes,
                        'bottomArrow': !field.showBoxes}">
                </span>
            </span>
        </div>
    </div>

    <div class="content collapsablePanelInner"
        ng-init="field.showBoxes = true"
        ng-slide-down="field.showBoxes"
        duration="0.5"
        ng-class="{'hidden': !field.showBoxes}">
        <div>
            <ul class="keyValueList clearfix loDashList odd">

                <li ng-repeat="item in ctrl.model.sections" class="loDashItem">

                    <strong class="key">
                        {{item.titular}}
                    </strong>

                    <span class="value db ellipsis">
                        {{item.subtitular}}
                    </span>
                </li>
            </ul>
        </div>
    </div>
</article>

and it would be in this controller where the call to the mockeados data of before would be made and I do not know very well how to make said call so that the data are shown.

JS 2

(function(angular) {
    'use strict';

    angular
        .module("app.preconcedidosHogar")
        .component('apResumenHogarBox', {
            templateUrl: 'app/preconcedidos/hogar/components/resumen/resumenHogarBox/resumenHogarBox.html',
            controller: apResumenHogar,
            controllerAs: 'ctrl',
            bindings: {
                title: '@',
                model: '<'
            }
        });

    function apResumenHogar($scope, EmitterSrv, $filter, ModalModel, AltaSrv, $rootScope, CoreSrv,
        constants, $state, ngDialog, OracleSrv,PreconcedidosHogarSrv) {
        var vm = this;

        vm.scope = $scope;

        vm.$onInit = function() {
            //vm.modelData = angular.copy(vm.model);
        };
    }

})(window.angular);

Could you help me please

Thank you very much, best regards

    
asked by derek 25.07.2018 в 11:38
source

0 answers