skip to Main Content

I want to generate a html page that works offline without any access to a webserver (file opened with an url like file:///PathToMyFile.html). In this page I use some JS libraries and CSS I have inlined in header but for AngularJS it fails because there are some HTML codes inside AngularJS.js file.
How can i do that.
For information, I do the generation with the Twirl template engine (Scala).

Thanks

<head>
    <style>
        bootstrapCSSLib
    </style>

    <script>
        jqueryLib
        boostrapLib
        angularJSLib
    </script>
</head>

Edit : Real code truncated because too big:

<!DOCTYPE html>
<html>
<head lang="en">
<style>
    /*!
     * Bootstrap v3.3.6 (http://getbootstrap.com)
     * Copyright 2011-2015 Twitter, Inc.  BLABLABLA FULL BOOTSTRAP.CSS CONTENT
</style>

<script>

     /*! jQuery v2.1.4 BLA BLA BLA FULL JQUERY.JS CONTENT
     /*!
      * Bootstrap v3.3.6 (http://getbootstrap.com) BLA BLA BLA FULL BOOTSTRAP.JS CONTENT
     /**
     * @license AngularJS v1.4.2
     * (c) 2010-2015 Google, Inc. http://angularjs.org
     * License: MIT  BLA BLA BLA FULL ANGULAR.JS CONTENT
</script>
</head>
<body>
...

2

Answers


  1. From AngularJS site:

    <script>
        angular.module('myApp', [])
          .controller('MyController', ['$scope', function ($scope) {
            $scope.greetMe = 'World';
          }]);
    
        angular.element(document).ready(function() {
          angular.bootstrap(document, ['myApp']);
        });
      </script>
    
    Login or Signup to reply.
  2. You can include angular like this

    <script type="text/javascript">
        //<![CDATA[
            inline angular script
        //]]>
    </script>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search