Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Burichan 17 posts 129 karma points
    Dec 05, 2017 @ 08:55
    Burichan
    0

    Custom data types & multi-valued $scope.model.value

    Assume that we need a custom data type, that will let the users store data through Umbraco content, in the following manner:

    <textarea ng-model="model.value[0].name" placeholder="Name . . ."></textarea>
    <textarea ng-model="model.value[0].telephone" placeholder="Phone . . ."></textarea>
    
    <hr/>
    
    <textarea ng-model="model.value[1].name" placeholder="Name . . ."></textarea>
    <textarea ng-model="model.value[1].telephone" placeholder="Phone . . ."></textarea>
    
    ...
    
    <hr />
    
    <textarea ng-model="model.value[n].name" placeholder="Name . . ."></textarea>
    <textarea ng-model="model.value[n].telephone" placeholder="Phone . . ."></textarea>
    

    This code does not work, I'm just trying to ask you guys if something like this is achievable and how.

    Thanks in advance.

  • Alex Skrypnyk 5774 posts 21998 karma points MVP 4x admin c-trib
    Dec 05, 2017 @ 10:21
    Alex Skrypnyk
    0

    Hi Burichan

    Can you show all the code?

    Alex

  • Burichan 17 posts 129 karma points
    Dec 05, 2017 @ 10:40
    Burichan
    0

    My (empty) controller:

    angular.module("umbraco").controller("Example", function ($scope) { } );
    

    And the manifest:

    { "propertyEditors": [{
      "alias": "Example",
      "name": "Example",
      "editor": {
        "view": "~/App_Plugins/Example/property.html",
        "valueType": "JSON"
      }
    }], "javascript": [ "~/App_Plugins/Example/property.controller.js" ] }
    

    Edit: The HTML contains nothing more than the markup on OP

Please Sign in or register to post replies

Write your reply to:

Draft