javascript - Running angular partial in a new tab -


i presenting issue in simple manner below

there index.html below

index.html <script src="js/libs/jquery/jquery.js"></script> <!--jquery library-->  <script src="js/libs/angularjs/angular.js"></script> <script src="js/libs/angularjs/app.js"></script>   {{title}}<br>  <ng-include src="'document.html'"></ng-include><br> <a href="document.html" target="_blank">newpage</a> 

my app.js follows

angular.module('myapp',[])  .controller('mycontroller',function($scope){     //array store items     $scope.title = "this test message";     $scope.secondpage = "this second page" }); 

the document.html follows

<div ng-controller="mycontroller"> {{secondpage}} </div> 

i need run document.html in new page, since document.html not have import script of angular.js,app.js won't render. if put script statements in document.html there multiple imports in index.html. how solve issue ? require.js not solve issue. 1 bad way solve issue import document.html text , remove importing statements.(bad bad way !!)

create new page new window opener similar index.html

so code like:

index.html

<script src="js/libs/jquery/jquery.js"></script> <!--jquery library-->  <script src="js/libs/angularjs/angular.js"></script> <script src="js/libs/angularjs/app.js"></script>  {{title}}<br>  <ng-include src="'document.html'"></ng-include><br> <a href="documentwindow.html" target="_blank">newpage</a>  

documentwindow.html

<script src="js/libs/jquery/jquery.js"></script> <!--jquery library-->  <script src="js/libs/angularjs/angular.js"></script> <script src="js/libs/angularjs/app.js"></script>  {{title}}<br>  <ng-include src="'document.html'"></ng-include><br> 

hope works you


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -