From 29b321647bc02ef21ed0347d96bf9544501e3246 Mon Sep 17 00:00:00 2001 From: Joshua Wilborn Date: Fri, 17 Mar 2017 10:15:44 -0400 Subject: [PATCH 1/6] docs ($compile): add error documentation for noslot error in $compile there was no error page for the $compile:noslot error this resolves #15790 --- docs/content/error/$compile/noslot.ngdoc | 45 ++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 docs/content/error/$compile/noslot.ngdoc diff --git a/docs/content/error/$compile/noslot.ngdoc b/docs/content/error/$compile/noslot.ngdoc new file mode 100644 index 000000000000..c4989f0bfbc1 --- /dev/null +++ b/docs/content/error/$compile/noslot.ngdoc @@ -0,0 +1,45 @@ +@ngdoc error +@name $compile:noslot +@fullName No matching slot in parent directive +@description + +This error occurs when declaring a specific slot in a ng-transclude which does not map to the transclude property of the directive. + +```js +// In this example the template has a declared slot missing from the transclude definition. +// This example will generate a no slot error. + +var componentConfig = { + template: '
' + + '
' + + '
' + + '
', + transclude: { + // The key value pairs here are considered "slots" that are provided for components to slot into. + slotProvided: 'slottedComponent', // mandatory transclusion, + optionalSlot: '?optionalComponent', // optional transclusion + // there is no slot provided for the transclude 'noSlotProvided' declared in the above template + } +}; + +angular + .module('doc') + .component('myComponent', componentConfig) + +``` + +```js +\\ if we the following change we will no longer get no slot error. +var componentConfig = { + template: '
' + + '
' + + '
' + + '
', + transclude: { + slotProvided: 'slottedComponent', // mandatory transclusion, + optionalSlot: '?optionalComponent', // optional transclusion, + noSlotProvided: 'otherComponent' // now it is declared and the error should cease + } +}; + +``` From b5fd53ff1403971aa4ea28b21133c10114815046 Mon Sep 17 00:00:00 2001 From: Joshua J Wilborn Date: Tue, 21 Mar 2017 17:02:26 -0400 Subject: [PATCH 2/6] docs ($compile): update error doc text removed styling moved comments outside of code blocks removed unneeded directive in example --- docs/content/error/$compile/noslot.ngdoc | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/docs/content/error/$compile/noslot.ngdoc b/docs/content/error/$compile/noslot.ngdoc index c4989f0bfbc1..262bebf44635 100644 --- a/docs/content/error/$compile/noslot.ngdoc +++ b/docs/content/error/$compile/noslot.ngdoc @@ -3,41 +3,33 @@ @fullName No matching slot in parent directive @description -This error occurs when declaring a specific slot in a ng-transclude which does not map to the transclude property of the directive. +This error occurs when declaring a specific slot in a ng-transclude which does not map to a specific slot defined in the transclude property of the directive. +In this example the template has a declared slot missing from the transclude definition. +This example will generate a noslot error. ```js -// In this example the template has a declared slot missing from the transclude definition. -// This example will generate a no slot error. - var componentConfig = { - template: '
' + + template: '
' + '
' + '
' + '
', transclude: { // The key value pairs here are considered "slots" that are provided for components to slot into. - slotProvided: 'slottedComponent', // mandatory transclusion, - optionalSlot: '?optionalComponent', // optional transclusion - // there is no slot provided for the transclude 'noSlotProvided' declared in the above template + slotProvided: 'slottedComponent', // mandatory transclusion + // There is no slot provided here for the transclude 'noSlotProvided' declared in the above template. } }; - -angular - .module('doc') - .component('myComponent', componentConfig) - ``` +If we the following change we will no longer get no slot error. ```js -\\ if we the following change we will no longer get no slot error. var componentConfig = { template: '
' + '
' + '
' + '
', transclude: { - slotProvided: 'slottedComponent', // mandatory transclusion, - optionalSlot: '?optionalComponent', // optional transclusion, + slotProvided: 'slottedComponent', noSlotProvided: 'otherComponent' // now it is declared and the error should cease } }; From 62152ce6372365acfa0ad3b79b164ad30e264dc2 Mon Sep 17 00:00:00 2001 From: Joshua J Wilborn Date: Tue, 21 Mar 2017 17:03:33 -0400 Subject: [PATCH 3/6] docs ($compile): fix grammar insert missing "make" to fix grammar --- docs/content/error/$compile/noslot.ngdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/error/$compile/noslot.ngdoc b/docs/content/error/$compile/noslot.ngdoc index 262bebf44635..59d2cdaf714e 100644 --- a/docs/content/error/$compile/noslot.ngdoc +++ b/docs/content/error/$compile/noslot.ngdoc @@ -21,7 +21,7 @@ var componentConfig = { }; ``` -If we the following change we will no longer get no slot error. +If we make the following change we will no longer get no slot error. ```js var componentConfig = { template: '
' + From 074bd6732316e0c6c6d9db5ecfbc31ed39443c8a Mon Sep 17 00:00:00 2001 From: Joshua J Wilborn Date: Tue, 21 Mar 2017 17:04:12 -0400 Subject: [PATCH 4/6] docs ($compile): fix name to match error "no slot" -> "noslot" --- docs/content/error/$compile/noslot.ngdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/error/$compile/noslot.ngdoc b/docs/content/error/$compile/noslot.ngdoc index 59d2cdaf714e..90220dea9ed2 100644 --- a/docs/content/error/$compile/noslot.ngdoc +++ b/docs/content/error/$compile/noslot.ngdoc @@ -21,7 +21,7 @@ var componentConfig = { }; ``` -If we make the following change we will no longer get no slot error. +If we make the following change we will no longer get noslot error. ```js var componentConfig = { template: '
' + From e16801c384e3fd35044e04abd3b2f8cb58e165c4 Mon Sep 17 00:00:00 2001 From: Joshua J Wilborn Date: Tue, 21 Mar 2017 20:00:15 -0400 Subject: [PATCH 5/6] docs ($compile): remove style tag from example remove second style tag from example --- docs/content/error/$compile/noslot.ngdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/error/$compile/noslot.ngdoc b/docs/content/error/$compile/noslot.ngdoc index 90220dea9ed2..f62eb301902c 100644 --- a/docs/content/error/$compile/noslot.ngdoc +++ b/docs/content/error/$compile/noslot.ngdoc @@ -24,7 +24,7 @@ var componentConfig = { If we make the following change we will no longer get noslot error. ```js var componentConfig = { - template: '
' + + template: '
' + '
' + '
' + '
', From ceb1509063d5ea695c57640ef44e929b7aa04cfe Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Wed, 22 Mar 2017 11:41:02 +0100 Subject: [PATCH 6/6] Fix small typos, and line length, and add link --- docs/content/error/$compile/noslot.ngdoc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/content/error/$compile/noslot.ngdoc b/docs/content/error/$compile/noslot.ngdoc index f62eb301902c..a882ddde0e7a 100644 --- a/docs/content/error/$compile/noslot.ngdoc +++ b/docs/content/error/$compile/noslot.ngdoc @@ -3,9 +3,10 @@ @fullName No matching slot in parent directive @description -This error occurs when declaring a specific slot in a ng-transclude which does not map to a specific slot defined in the transclude property of the directive. +This error occurs when declaring a specific slot in a {@link ng.ngTransclude `ngTransclude`} +which does not map to a specific slot defined in the transclude property of the directive. -In this example the template has a declared slot missing from the transclude definition. +In this example the template has declared a slot missing from the transclude definition. This example will generate a noslot error. ```js var componentConfig = { @@ -21,7 +22,7 @@ var componentConfig = { }; ``` -If we make the following change we will no longer get noslot error. +If we make the following change we will no longer get the noslot error. ```js var componentConfig = { template: '
' +