1

my application developed with AngularJS but now i'm going to implement 'Mosaico Email Template Editor' (which is developed with KnockoutJS).. so How Can i Use both Angular and Knockout On Same Page.. any one can explain with sample code.. ?? tanx in advance

my sample code :

<script  type="text/javascript" src="js/core/controller/knockout.js"></script>
<script src="dist/vendor/jquery.min.js"></script>
<script type="text/javascript" src="js/core/controller/controller.js"></script>

    <div data-bind="foreach: templates">
          <div class="template template-xx" style="" data-bind="attr: { class: 'template template-'+name }">
            <div class="description" style="padding-bottom:5px"><b data-bind="text: name">xx</b>: <span data-bind="text: desc">xx</span></div>
            <a href="#" data-bind="click: $root.newEdit.bind(undefined, name), attr: { href: 'editor.html#templates/'+name+'/template-'+name+'.html' }">
              <img src="/images/full.png" width="100%" alt="xx" data-bind="attr: { src: 'templates/'+name+'/edres/_full.png' }">
            </a>
          </div>
        </div>


 *[and JS file below - controller.js][1]*

    var viewModel = 
          {
               templates: 
                [
                    {
                      name: 'versafix-1', desc: 'The versatile template'
                    },
                    {
                      name: 'tedc15', desc: 'The TEDC15 template'
                    }        
                ]

          };

    document.addEventListener('DOMContentLoaded',function(){
            ko.applyBindings(viewModel);
          });

First two image - what i expect but i get now right side one...i think knockout binding not working properly in my page:

First two image - what i expect but i get now right side one...i think knockout binding not working properly in my page

abernier
  • 27,030
  • 20
  • 83
  • 114
Sago
  • 11
  • 3
  • How do you want to do the integration ? As I see, Mosaico is a standalone app already has front-end and back-end. – Lulylulu Apr 14 '16 at 07:53
  • for binding it should work with knockout as it is., but i want to communicate and exchange values with angular controller., for front-end no pblm but for backend they used Node.js but i used Java for API call and other stuff.. my problem knockout binding not working when i load their html page via Angular – Sago Apr 14 '16 at 07:59
  • could you please provide some code - without it we can't find an error. Because I feel these two can work together. – Роман Иванов Apr 14 '16 at 08:02
  • this is what i tried but not working http://stackoverflow.com/questions/32908775/passing-variables-between-knockoutjs-and-angularjs passing variables between knockout and angular controller.. – Sago Apr 14 '16 at 09:51
  • 1
    my answer was deleted, but i think that could help with this problem, at least as a starting point: could be, that this angular mosaico "wrapper" helps you: https://github.com/leikir/angular-mosaico – Stefan Wuthrich - Altafino Jan 24 '17 at 09:35

0 Answers0