Lade-Bildschirm im Winkel 2

Ich würde gerne verwirklichen pre-bootstrap-loading-Bildschirm in Angular2 Projekt. Ich habe mehrere Proben für Angular1. Zum Beispiel dieses:

<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>
    Creating A Pre-Bootstrap Loading Screen In AngularJS
</title>
</head>
<body ng-controller="AppController">
<div class="m-app-loading" ng-animate-children>
    <style type="text/css">
        some styling...
    </style>
    <!-- BEGIN: Actual animated container. -->
    <div class="animated-container">
        <div class="messaging">
            <h1>
                App is Loading
            </h1>
            <p>
                Please stand by for your ticket to awesome-town!
            </p>
        </div>
    </div>
    <!-- END: Actual animated container. -->
</div>
<!-- END: App-Loading Screen. -->
<h1>
    Creating A Pre-Bootstrap Loading Screen In AngularJS
</h1>
<p>
    You have {{ friends.length }} friends:
</p>
<ul>
    <li ng-repeat="friend in friends">
        {{ friend }}
    </li>
</ul>
<script type="text/javascript" src="../../vendor/angularjs/angular-1.3.8.min.js"></script>
<script type="text/javascript" src="../../vendor/angularjs/angular-animate-1.3.8.min.js"></script>
<script type="text/javascript">
    var app = angular.module( "Demo", [ "ngAnimate" ] );
    setTimeout(
        function asyncBootstrap() {
            angular.bootstrap( document, [ "Demo" ] );
        },
        ( 2 * 1000 )
        );
    app.controller(
        "AppController",
        function( $scope ) {
            console.log( "App Loaded!", $scope );
            $scope.friends = [ "Kim", "Sarah", "Tricia" ];
        }
        );
    app.directive(
        "mAppLoading",
        function( $animate ) {
            return({
                link: link,
                restrict: "C"
            });
            function link( scope, element, attributes ) {
                $animate.leave( element.children().eq( 1 ) ).then(
                    function cleanupAfterAnimation() {
                        element.remove();
                        scope = element = attributes = null;
                    }
                    );
            }
        }
        );
</script>
</body>
</html>

Es ist ein demo. Ich bin immer in Schwierigkeiten, weil ich habe angefangen zu lernen, Eckig 2 vor kurzem, und nicht weiß, Eckig 1. Wie "konvertieren" diese JS-code zu TS? Danke!

JS-code fast jedes mal, wenn eine gültige TS-code. Es geht nicht um das konvertieren JS, TS. Es ist eher zum konvertieren von Winkel zu Winkel 2.
Sie haben eine ähnliche Frage hier und Lösung von mir hier eine stackoverflow.com/questions/35243443/...
Lösung hier: stackoverflow.com/questions/35243443/...

InformationsquelleAutor Nursultan Bagidolla | 2015-12-23

Schreibe einen Kommentar