小编use*_*119的帖子

用ngroute传递参数

这是我的

angularroute.html

<html xmlns="http://www.w3.org/1999/xhtml" ng-app="AngularApp">
<head>
    <title></title>
    <script src="angular.js"></script>
    <script src="angular-route.js"></script>
    <script type="text/javascript">

        var AngApp = angular.module('AngularApp', ['ngRoute']);
        AngApp.config(function ($routeProvider) {
            $routeProvider
                .when('/Route1/:ID', {
                    templateUrl:'Route1.html',
                    controller:'Route1'

                })
                .when('/Route2', {
                    templateUrl: 'Route2.html',
                    controller:'Route2'
                })

                .otherwise({
                    redirectTo: '/'
                });
        });

    </script>

            </head>
            <body>

                <p>Routing Explained</p>
                <a href="#Route1/100">Route1</a><br>
                <a href="#Route2">Route2</a>
                <div ng-view>

                </div>

                <script src="Route.js"></script>       


            </body>
            </html>
Run Code Online (Sandbox Code Playgroud)

Route.js文件包含.

angular.module('Route1').controller('Route1', function ($scope, $routeParams) {
    $scope.ID = $routeParams.ID;
});

angular.module('Route2').controller('Route2', function () {
});
Run Code Online (Sandbox Code Playgroud)

Route1.html

<html xmlns="http://www.w3.org/1999/xhtml" ng-app="Route1">
<head>
    <title></title>

</head>
<body ng-controller="Route1">


    {{ID}}

    {{4+10}} …
Run Code Online (Sandbox Code Playgroud)

javascript angularjs

5
推荐指数
1
解决办法
2万
查看次数

在 WSL 上安装并运行 Airflow

我按照这篇文章中的过程在 WSL (Windows 10) 下的 Ubuntu 中安装了 Airflow 。

但运行时airflow db init,出现以下错误:

AttributeError: module 'wtforms.fields' has no attribute 'TextField'
Run Code Online (Sandbox Code Playgroud)

完整跟踪:

(airflow_env) sultani@Khalid:~/c/users/administrator/airflowhome$ airflow db init
DB: sqlite:///c/users/administrator/airflowhome/airflow.db
[2022-06-09 00:41:54,760] {db.py:1448} INFO - Creating tables
INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
Traceback (most recent call last):
  File "/home/sultani/.local/bin/airflow", line 8, in <module>
    sys.exit(main())
  File "/home/sultani/.local/lib/python3.8/site-packages/airflow/__main__.py", line 38, in main
    args.func(args)
  File "/home/sultani/.local/lib/python3.8/site-packages/airflow/cli/cli_parser.py", line 51, in command
    return func(*args, **kwargs)
  File "/home/sultani/.local/lib/python3.8/site-packages/airflow/cli/commands/db_command.py", line …
Run Code Online (Sandbox Code Playgroud)

windows ubuntu airflow windows-subsystem-for-linux

1
推荐指数
1
解决办法
2843
查看次数