2016-08-30 4 views

答えて

4

最後に、自分で解決策を見つけました。複数のアプリケーションを実行する場合の競合を避けるために、特定の要素の角型アプリケーションをブートストラップするだけで済みます。スクリプトのajax呼び出しを実装しました。

例:この場合

<link rel="import" href="../polymer/polymer.html"> 

<!-- Defines element markup --> 
<dom-module id="my-element"> 
<template> 
    <div id="my-app"> 
     <ui-view></ui-view> 
    </div> 
</template> 
<!-- Registers custom element --> 
<script> 
Polymer({ 
    is: 'my-element', 

    // Fires when an instance of the element is created 
    created: function() {}, 

    // Fires when the local DOM has been fully prepared 
    ready: function() { 
      $.getScript('./app/may-ng-app.min.js'); 
    }, 

    // Fires when the element was inserted into the document 
    attached: function() {}, 

    // Fires when the element was removed from the document 
    detached: function() {}, 

    // Fires when an attribute was added, removed, or updated 
    attributeChanged: function(name, type) {} 
}); 
</script> 
</dom-module> 

my-app要素に角度アプリブートストラップ。そして我々は別々の角度のアプリケーションを展開し、ポリマー容器に保持することができます。それは私たちに柔軟性を与え、ページのダウンロードをスピードアップします。

関連する問題