問題タブ [angularjs-ng-include]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
2 に答える
1018 参照

angularjs - ng-repeat 内で anchorScroll を作成する方法を知っている人はいますか?

ng-repeat メニュー内のさまざまな ID に anchorScroll を作成する方法を知る必要があります。

ありがとう!

0 投票する
2 に答える
13533 参照

angularjs - Angular JS ng-Include 式

ng-includeこれまで運がなかったので、ドキュメントを読み込もうとしました。私がやりたいng-includeのは、テンプレート/部分的な場所のパスを評価して、コンテンツをロードすることだけです:

コンソールにpageData.src戻っていることがわかります。"tpl/page.html"次のバリエーションを試しました。

それらのどれも式を評価していないようです。次のエラーが表示されます。

フィードバックをお待ちしております。

0 投票する
1 に答える
7277 参照

javascript - Directives inside ng-include

I'm building a simple angularjs app and I'm trying to implement login without page refresh.

What I'm doing

On init the ng-include loads the /set/save. The /set/save got the <a fblogin>Login with Facebook</a> in it. So when clicked the directive opens a window and when the window is closed it should change the src of the ng-include.

The problem

When the directive is used inside the ng-include ( ng-include src has default value on init ), nothing happens ( no errors in console, just nothing ), but when I put the directive outside the ng-include it's working fine ( see HTML code below )

HTML:

Directive:

Controller:

And /set/save

0 投票する
1 に答える
1439 参照

angularjs - RequireJS で ngInclude を使用する AngularJS

ngInclude を使用して、すべてのビューに共通のヘッダー テンプレートを読み込もうとしています。問題は、アプリを遅延ロードするために RequireJS を使用していることです。

したがって、私のコードは次のようになります。

index.html

ブートストラップ.js

app.js

HeaderModule.js

menuItems.js

header.html

これによりエラーは発生しませんが、ヘッダービューも表示されません-テンプレートが読み込まれていないためだと思います。ここで何が欠けているかについて何か考えはありますか?

ありがとう

0 投票する
2 に答える
29704 参照

javascript - src の変数を含む ng-include

ng-includes src を変数で変更したいと思います。現在、これは私が持っているものです。

そして、ここにコントローラーがあります:

残念ながら、このページにアクセスするために既に使用されているため、ng-view を使用できません。この作品のようなものを作ることは可能ですか?