Copied to clipboard

Flag this post as spam?

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


  • Darren Eccles 59 posts 298 karma points
    Apr 04, 2018 @ 13:13
    Darren Eccles
    0

    is it possible to link to a newer version of angularjs for a custom property editor?

    Hi Guys,

    Just wondering if its possible to link to a newer version of angularjs for a custom property editor?

    Thanks

    Darren

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Apr 04, 2018 @ 13:19
    Michaël Vanbrabandt
    0

    Hi Darren,

    never tried this before but perhaps you can include the angular js file in your package manifest:

    {
        javascript: [
            '~/App_Plugins/YourPropertyEditor/yourangular.js'
        ]
    }
    

    I think it will conflict with Umbraco but again, never tried it before.

    Hope this helps.

    /Michaël

  • Darren Eccles 59 posts 298 karma points
    Apr 04, 2018 @ 13:24
    Darren Eccles
    0

    Hi Michael,

    Thanks for your quick response, I've tried that, but using this instead:

    https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.5/angular.min.js

    This didn't work.

    I'm building a dynamic form and I need a newer version of angularjs to deal with the validation side of things.

    Thanks again,

    Darren

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Apr 04, 2018 @ 15:29
    Dave Woestenborghs
    0

    Hi Darren,

    Can you explain what your are missing in the current angular version shipped with Umbroc that is in 1.6.5 ?

    Dave

  • Darren Eccles 59 posts 298 karma points
    Apr 04, 2018 @ 15:49
    Darren Eccles
    0

    Hi Dave,

    I'm building a dynamic form which has dynamic field names. Please see code sample below: (this works in a seperate html page if I reference 'angularjs 1.6.5')

    <form name="form">
    <div ng-repeat="field in fields">
        <div ng-if="field.type == 'input'">
            <label>{{field.label}}</label>
            <div>
                <input 
                       type="text" 
                       ng-attr-name="{{field.key}}" 
                       ng-model="formvalue[field.key]" 
                       placeholder="{{field.templateOptions.placeholder}}" 
                       ng-required="{{field.templateOptions.required}}"
                       >
            </div>
            <div ng-if="form[field.key].$error.required"> Field Required</div>
        </div>
    </div>
    

    I'm pretty sure umbraco is referencing 'angularjs 1.1.5', now when I reference 1.6.5 the following piece of code works:

    form[field.key].$error.required
    

    I have this code working in a seperate html page referencing 1.6.5, I just need to be able to use the same code in the property editor.

    Hope this makes sense, thanks

    Darren

  • Darren Eccles 59 posts 298 karma points
    Apr 04, 2018 @ 16:11
    Darren Eccles
    0

    To be honest Dave, this may work on earlier versions of angularjs (e.g 1.4, 1.5 etc...).

    I just used the latest version and it worked.

    https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.5/angular.min.js

    Darren

Please Sign in or register to post replies

Write your reply to:

Draft