問題タブ [angular-components]

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 投票する
21 に答える
746191 参照

angular - Angular 2+ の ngShow と ngHide に相当するものは何ですか?

特定の条件下で表示したい要素がいくつかあります。

AngularJS では、次のように記述します。

Angular 2+でこれを行うにはどうすればよいですか?

0 投票する
20 に答える
298089 参照

css - 親コンポーネントのCSSファイルから子コンポーネントをスタイルする方法は?

私は親コンポーネントを持っています:

そして、このグループに子コンポーネントを追加したいと思います:

親テンプレート:

子テンプレート:

parentとは 2 つの別個のコンポーネントであるためchild、それらのスタイルは独自のスコープにロックされています。

私の親コンポーネントで私はやってみました:

しかし、スタイルはコンポーネント.childに適用されていません。child

スコープの問題を解決するために、のスタイルシートをコンポーネントstyleUrlsに含めるために使用してみました:parentchild

しかし、それは役に立ちませんでした。また、childスタイルシートをフェッチして別の方法を試しましたparentが、どちらも役に立ちませんでした。

では、親コンポーネントに含まれる子コンポーネントのスタイルをどのように設定するのでしょうか?

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

angularjs - angularコンポーネントの「バインディング」パラメータの何が問題になっていますか?

ページに含めたい角度のあるコンポーネントがあります。このコンポーネントのbindingsパラメータをコメント/削除すると、すべてが機能します...なぜですか?

バインディングパラメーターを使用したい場合、次のエラーが発生します。

ここに画像の説明を入力

リンク先: https://docs.angularjs.org/error/ $compile/iscp?p0=detailsComponent1&p1=value&p2=Component1&p3=controller%20bindings%20definition

どういう意味ですか ??

ありがとう。

0 投票する
0 に答える
105 参照

angularjs - Angular JS - カスタム フィルター - 競合状態エラー

さて、私の問題は単純です。競合状態エラーです。フィルターが使用しようとすると配列が作成されませんが、ページがすべてをロードして正常に動作すると、このようにページが完全にロードされる前にコンソールにいくつかのエラーが表示されます:

そして、私が持っている他の質問は、なぜこのエラーが13回表示されるのですか?? 自分では対応できません。

これが私のコードです:

テンプレート HTML

モジュールの作成:

コントローラー (コンポーネント定義)

0 投票する
3 に答える
934 参照

javascript - Configure ui-router with components containing multiple bindings

I am trying to find a better solution to use the ui-router together with angular components.

Consider two simple components:

Right now, I am specifying the component and its parameter using the template property:

While this is working fine, I have components with arround ten bindings which makes the configuration of the ui-router realy awkward.

I tried using the component property but this doesn't work for me at all. The only other solution I found is to specify the parent using the require property and omit the bindings - but this doesn't feel right for me... Is there a better way to do this?

Here is a plnkr.